From: Ryan Davis Date: 2013-02-14T16:59:54+09:00 Subject: Re: Can't load gems On Feb 13, 2013, at 21:21 , Loran Kary wrote: > Ryan Davis wrote in post #1096802: >> On Feb 13, 2013, at 16:37 , Loran Kary wrote: >> >>> Why can't Ruby find my gems when I require them? >> >> To start, make sure that `which gem` and `which ruby` are answering with >> the same install. > > Sure, thanks. > > bash-3.2$ which ruby > /Users/kary/.rvm/rubies/ruby-1.9.3-p286/bin/ruby > bash-3.2$ which gem > /Users/kary/.rvm/rubies/ruby-1.9.3-p286/bin/gem > bash-3.2$ gem list actionmailer > > *** LOCAL GEMS *** > > actionmailer (3.2.9) > bash-3.2$ gem which actionmailer > ERROR: Can't find ruby library file or shared library actionmailer % gem which minitest ERROR: Can't find ruby library file or shared library minitest % gem contents minitest | grep lib /Library/Ruby/Gems/1.8/gems/minitest-4.6.0/lib/hoe/minitest.rb /Library/Ruby/Gems/1.8/gems/minitest-4.6.0/lib/minitest/autorun.rb /Library/Ruby/Gems/1.8/gems/minitest-4.6.0/lib/minitest/benchmark.rb /Library/Ruby/Gems/1.8/gems/minitest-4.6.0/lib/minitest/hell.rb /Library/Ruby/Gems/1.8/gems/minitest-4.6.0/lib/minitest/mock.rb /Library/Ruby/Gems/1.8/gems/minitest-4.6.0/lib/minitest/parallel_each.rb /Library/Ruby/Gems/1.8/gems/minitest-4.6.0/lib/minitest/pride.rb /Library/Ruby/Gems/1.8/gems/minitest-4.6.0/lib/minitest/spec.rb /Library/Ruby/Gems/1.8/gems/minitest-4.6.0/lib/minitest/unit.rb % gem which minitest/unit /Library/Ruby/Gems/1.8/gems/minitest-4.6.0/lib/minitest/unit.rb There is no minitest.rb so it bitches. There is a minitest/unit.rb so it finds it. The easiest way to figure that out is to just look. I used `gem contents` to do that but I also often just go into the code and poke around. In your case, there is no actionmailer.rb, however, there is an action_mailer.rb 10006 % pwd /Users/ryan/Work/git/rails/actionmailer/ 10007 % l lib total 8 0 action_mailer/ 8 action_mailer.rb 0 rails/