Ruby gem , require and version problem

M

Marc Hoeppner

Hi,

I am trying to specify the version a gem, which is installed in two
versions under slightly different names as a result of forked projects
which we now intend to merge back.

Looks like this in 'gem list'
ruby-foo-bar (0.9.2)
foo-bar (0.9)

Both are supposedly required with:
require 'bar'

Now, I need to specifiy which of the two to use for my script - and I
started with

require 'rubygems'
gem 'bar', '0.9.2'

Throws an error
/usr/lib/ruby/1.8/rubygems.rb:827:in `report_activate_error': Could not
find RubyGem bar (= 0.9.2) (Gem::LoadError)

Ok, so then I tried specifiying the names as they appear in the 'gem
list'

require 'rubygems'
gem 'ruby-foo-bar', '0.9.2'

That doesn't throw an error, but the game is apparently not loaded as
the modules and classes are not recognized subsequently.

System is a fairly fresh install of Ubuntu 9.19, 64 bit and ruby 1.8.7,
rubygems version is 1.3.5

Any advice would be appreciated.
 
R

Ryan Davis

require 'rubygems'
gem 'ruby-foo-bar', '0.9.2'

That doesn't throw an error, but the game is apparently not loaded as
the modules and classes are not recognized subsequently.

gem doesn't load any files, it just activates the right gem.

require 'rubygems'
gem 'ruby-foo-bar', '0.9.2'
require 'bar'
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top