I’m having trouble getting Ruby to find a gem I installed. Here’s what I’m doing:
First off, I’m on a private server, if that makes a difference.
I run “gem install facebooker” and it seems to succeed, though it reports that it had to install to ~/.gem since “/usr/lib/ruby/gems/1.8” is write protected.
I try running a simple ruby script that does nothing else but require “facebooker” and I get the following error:
gem_original_require': no such file to load -- facebooker (LoadError) \tfrom /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
Premature end of script headers: test.rb
If I change the script to require the full path to the installed facebooker.rb, it gets found okay, but then an error is reported trying to load json, one of its dependencies. (I don’t understand why the already installed json gem under “/usr/lib/ruby/gems/1.8” does get found in this case, but maybe this is a different issue.)
Adding the following lines to .bash_profile and then ran “source ~/.bash_profile” as instructed by the wiki (http://wiki.dreamhost.com/index.php/RubyGems) made no difference. (And anyway, .bash_profile only applies to ssh session, right?)
And I’m stumped. I feel like I must be missing some obvious thing. What is it?