Ruby + Rails Install on Snow Leopard
Jun 28th, 2010 by tammy
I followed the HiveLogic Ruby/Rails/Snow Leopard Install Guide and installed my own version of ruby/rails in /usr/local. Very straightforward and well reasoned guide.
My installation did not work without some post-tweaking though.
I had to change the /usr/local/bin/rake that gem installed to permissions 755. The “sudo gem install rake” command had the ownership/perms so that only root could see it.
Before I fixed the perms root picked up all /usr/local/bin versions of rails + tools (good) but my own user got /usr/bin/rake instead of /usr/local/bin. Here’s how to test that:
for cmd in ruby irb gem rake; do which $cmd; done
Next issue, I was getting this error any time I tried to run ruby:
gem environment
/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:10:in `require': no such file to load -- rubygems/defaults (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:10
from /usr/local/bin/gem:8:in `require'
from /usr/local/bin/gem:8
Turns out /usr/local/lib/ruby/site_ruby/1.8/rubygems directory has perms 750 and is owned by root/wheel. The equivalent OS X system version in /usr/lib/ruby/site_ruby/1.8/rubygems has same perms but ownership root/admin. I decided to create a dev group, add my user to that group and change the group ownership of /usr/local/lib/ruby.
I also ended up having to change the perms on /usr/local/bin/rails to allow all users to read and execute.
Success!





