tags:

views:

206

answers:

1

I'm using MacPorts in order to manage my Ruby/Rails/Gems installations. Recently after doing a gem install wirble, wirble fails to load when I start an instance of irb. Here's the output:

$ irb --simple-prompt
Couldn't load Wirble: no such file to load -- wirble

The Wirble gem doesn't show up in my $LOAD_PATH:

>> puts $:
/opt/local/lib/ruby1.9/gems/1.9.1/gems/actionmailer-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/actionpack-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activerecord-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activeresource-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/mysql-2.8.1/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/mysql-2.8.1/ext
/opt/local/lib/ruby1.9/gems/1.9.1/gems/mysql-2.8.1/bin
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.1/bin
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rack-1.0.1/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rails-2.3.5/bin
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rails-2.3.5/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/bin
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.8.7/lib
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rubygems-update-1.3.7/hide_lib_for_update
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rubygems-update-1.3.7/bin
/opt/local/lib/ruby1.9/site_ruby/1.9.1
/opt/local/lib/ruby1.9/site_ruby/1.9.1/i386-darwin10
/opt/local/lib/ruby1.9/site_ruby
/opt/local/lib/ruby1.9/vendor_ruby/1.9.1
/opt/local/lib/ruby1.9/vendor_ruby/1.9.1/i386-darwin10
/opt/local/lib/ruby1.9/vendor_ruby
/opt/local/lib/ruby1.9/1.9.1
/opt/local/lib/ruby1.9/1.9.1/i386-darwin10
.
=> nil
>> 

The gem is definitely installed:

$ gem list |grep -i wirble
wirble (0.1.3)

It is located in /opt/local/lib/ruby/gems/1.9.1/gems/wirble-0.1.3/

How do I get this and future gems I installed appended to my $LOAD_PATH?

A: 

Did you require RubyGems in irb?

require 'rubygems'

will probably be necessary before requiring any gems. You can also put this line in ~/.irbrc so you RubyGems will automatically be required when irb is started up.

I'm not sure why some of your Gems are in your load path -- gems usually don't appear in $:.

mipadi
I'm using Ruby 1.9.1, should have specified that. Ruby 1.9 doesn't require the use of require 'rubygems'
randombits