I just installed Rails on OSX. I used the stock version of Ruby and followed the following procedure:
- Installed newes开发者_StackOverflow中文版t version of RubyGems
- Ran sudo gem install rails --include-dependencies
- Installed Mongrel using sudo gem install mongrel --include-dependencies
Rails is working just fine, but more reading led me to this setup guide:
http://hivelogic.com/articles/ruby-rails-mongrel-mysql-osx
This is essentially the exact same install I performed, except he compiles it from source code and installs to /usr/local -- I really like this idea, since it keeps the OSX install stock and confines all my dev stuff to one area.
So, assuming I want to follow these instructions, what do I need to do to revert my system back to "stock" ruby? Can I just uninstall the Rails and Mongrel gems? Will the upgraded RubyGems cause any issues?
Basically, my concern is that some other software unrelated to my development work will need to use OSX's stock Ruby, and I will have screwed it up somehow. Any advice to undo the 3 steps I listed above and get as close to stock as possible would be appreciated.
Thanks!
The article you are referring to is over three years old (which is outdated in the Rails community). My recommendation is:
- Install XCode
- Install Homebrew
- Install MySQL, Postgres, Image Magick, etc. (brew install mysql, etc.)
- Install RVM
- Install Ruby 1.9.2 (rvm install 1.9.2)
- Switch to default (rvm 1.9.2 --default)
- Install Rails (gem install rails)
- Install Passenger (gem install passenger)
Each step will have a few more substeps but you should be able to look them up or be promted with them.
I can't remember why I did this but I do know that it worked and has caused no problems since. I moved /Library/Ruby to /Library/Ruby.broken and then installed Ruby from source into /usr/local.
There's something fundamentally missing with the stock Ruby in OSX. I wish I could remember what that was.
精彩评论