From: Matthew Eichler on
I'm trying to use the XML builder package, but the require is not working.
I have a hunch that I don't have all the requisite dependencies installed,
but what, I can't figure out. Note, I'm a Ruby newbie.

I've tried the following on Fedora and CygWin after doing a "gem install
builder" on both systems:

require 'csv'
require 'builder'

xml = Builder::XmlMarkup.new( :target => "tmp.xml", :indent => 2 )
xml.instruct!(:xml, :version => "1.1", :encoding => "UTF-8")
xml.declare!(:DOCTYPE, "beans", :PUBLIC, "-//SPRING//DTD BEAN//EN",
"http://www.springframework.org/dtd/spring-beans.dtd";)

xml.beans do
CSV::Reader.parse(File.open('tmp.csv', 'rb')) do |row|
xml.loginId( row[1] ) if row[1] != nil
end
end

... and I just get: transform-csv.rb:11:in `require': no such file to load
-- builder (LoadError)
from transform-csv.rb:11

--
Matthew Eichler
Aventine Solutions
IT that fits
matthew.eichler(a)aventinesolutions.nl



From: Farrel Lifson on
On 01/08/06, Matthew Eichler <matthew.eichler(a)aventinesolutions.nl> wrote:
> I'm trying to use the XML builder package, but the require is not working.
> I have a hunch that I don't have all the requisite dependencies installed,
> but what, I can't figure out. Note, I'm a Ruby newbie.
>
> I've tried the following on Fedora and CygWin after doing a "gem install
> builder" on both systems:
>
> require 'csv'
> require 'builder'
>
> xml = Builder::XmlMarkup.new( :target => "tmp.xml", :indent => 2 )
> xml.instruct!(:xml, :version => "1.1", :encoding => "UTF-8")
> xml.declare!(:DOCTYPE, "beans", :PUBLIC, "-//SPRING//DTD BEAN//EN",
> "http://www.springframework.org/dtd/spring-beans.dtd";)
>
> xml.beans do
> CSV::Reader.parse(File.open('tmp.csv', 'rb')) do |row|
> xml.loginId( row[1] ) if row[1] != nil
> end
> end
>
> ... and I just get: transform-csv.rb:11:in `require': no such file to load
> -- builder (LoadError)
> from transform-csv.rb:11
>
> --
> Matthew Eichler
> Aventine Solutions
> IT that fits
> matthew.eichler(a)aventinesolutions.nl
>
>
>
>

Have you tried:
require 'rubygems'
require_gem 'builder'

Farrel

From: Matthew Eichler on
Farrel,

OK, then I get
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:204:in `report_activate_error':
Could not find RubyGem builder (> 0.0.0) (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:141:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:37:in
`require_gem_with_options'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:31:in `require_gem'
from transform-csv.rb:12

gr, Mat

> On 01/08/06, Matthew Eichler <matthew.eichler(a)aventinesolutions.nl> wrote:
>> I'm trying to use the XML builder package, but the require is not
>> working.
>> I have a hunch that I don't have all the requisite dependencies
>> installed,
>> but what, I can't figure out. Note, I'm a Ruby newbie.
>>
>> I've tried the following on Fedora and CygWin after doing a "gem install
>> builder" on both systems:
>>
>> require 'csv'
>> require 'builder'
>>
>> xml = Builder::XmlMarkup.new( :target => "tmp.xml", :indent => 2 )
>> xml.instruct!(:xml, :version => "1.1", :encoding => "UTF-8")
>> xml.declare!(:DOCTYPE, "beans", :PUBLIC, "-//SPRING//DTD BEAN//EN",
>> "http://www.springframework.org/dtd/spring-beans.dtd";)
>>
>> xml.beans do
>> CSV::Reader.parse(File.open('tmp.csv', 'rb')) do |row|
>> xml.loginId( row[1] ) if row[1] != nil
>> end
>> end
>>
>> ... and I just get: transform-csv.rb:11:in `require': no such file to
>> load
>> -- builder (LoadError)
>> from transform-csv.rb:11
>>
>> --
>> Matthew Eichler
>> Aventine Solutions
>> IT that fits
>> matthew.eichler(a)aventinesolutions.nl
>>
>>
>>
>>
>
> Have you tried:
> require 'rubygems'
> require_gem 'builder'
>
> Farrel
>


--
Matthew Eichler
Aventine Solutions
IT that fits
matthew.eichler(a)aventinesolutions.nl



From: Daniel Harple on
On Aug 1, 2006, at 10:46 AM, Matthew Eichler wrote:

> Farrel,
>
> OK, then I get
> /usr/lib/ruby/site_ruby/1.8/rubygems.rb:204:in
> `report_activate_error':
> Could not find RubyGem builder (> 0.0.0) (Gem::LoadError)
> from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:141:in `activate'
> from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:37:in
> `require_gem_with_options'
> from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:31:in
> `require_gem'
> from transform-csv.rb:12
>
> gr, Mat

Only use require_gem if you need a specific gem version ? and if you
do you still need to ?require "the_gem_lib"?. I think require_gem is
now named activate_gem to help lessen the confusion.

To get it to work:

require "rubygems"
require "builder"

-- Daniel


From: Matthew Eichler on
Sorry, I posted too fast. The it works now on Fedora but not on CygWin,
so I'm just somehow missing this "RubyGem builder" thingy on CygWin.

gr, Mat

> Farrel,
>
> OK, then I get
> /usr/lib/ruby/site_ruby/1.8/rubygems.rb:204:in `report_activate_error':
> Could not find RubyGem builder (> 0.0.0) (Gem::LoadError)
> from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:141:in `activate'
> from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:37:in
> `require_gem_with_options'
> from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:31:in `require_gem'
> from transform-csv.rb:12
>
> gr, Mat
>
>> On 01/08/06, Matthew Eichler <matthew.eichler(a)aventinesolutions.nl>
>> wrote:
>>> I'm trying to use the XML builder package, but the require is not
>>> working.
>>> I have a hunch that I don't have all the requisite dependencies
>>> installed,
>>> but what, I can't figure out. Note, I'm a Ruby newbie.
>>>
>>> I've tried the following on Fedora and CygWin after doing a "gem
>>> install
>>> builder" on both systems:
>>>
>>> require 'csv'
>>> require 'builder'
>>>
>>> xml = Builder::XmlMarkup.new( :target => "tmp.xml", :indent => 2 )
>>> xml.instruct!(:xml, :version => "1.1", :encoding => "UTF-8")
>>> xml.declare!(:DOCTYPE, "beans", :PUBLIC, "-//SPRING//DTD BEAN//EN",
>>> "http://www.springframework.org/dtd/spring-beans.dtd";)
>>>
>>> xml.beans do
>>> CSV::Reader.parse(File.open('tmp.csv', 'rb')) do |row|
>>> xml.loginId( row[1] ) if row[1] != nil
>>> end
>>> end
>>>
>>> ... and I just get: transform-csv.rb:11:in `require': no such file to
>>> load
>>> -- builder (LoadError)
>>> from transform-csv.rb:11
>>>
>>
>> Have you tried:
>> require 'rubygems'
>> require_gem 'builder'
>>
>> Farrel
>>