Hi, using OS X 10.5.6 I installed fxruby using
$sudo port install rb-fxruby
As suggested in the book.
It works, my hello world program worked correctly.
Now, though, other code that I have written is broken, whenever I try to use any code that relies on a gem, it does not work. When I do
$ruby -e "require 'rubygems'"
in my code, it gives
"LoadError: no such file to load — rubygems"
When I set my RUBYOPT="rubygems"
in my .bash_profile
$ruby -e "puts 'hello world'"
ruby: no such file to load -- ubygems (LoadError)
(it says 'ubygems' without the 'r' on the front, not sure why)
http://newsgroups.derkeiler.com/Archive/Comp/comp.lang.ruby/2008-08/msg00351.html suggests I check my gem location against my ruby location, I get:
$cat `which gem` | head -n 1
#!/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
$ls -l `which ruby`
-rwxr-xr-x 2 root admin 12680 Feb 7 03:40 /opt/local/bin/ruby
I assume this means that the gems are confused, but not sure how to remedy it. Any ideas? It sucks not having gems.
---UPDATE---
Forgot to list versions:
$which gem
/usr/bin/gem
$gem --version
1.3.5
$ruby --version
ruby 1.8.7 (2009-04-08 patchlevel 160) [i686-darwin9]