简体   繁体   中英

Ruby on Rails on OSX - did I mess up my install?

I just installed Rails on OSX. I used the stock version of Ruby and followed the following procedure:

  1. Installed newest version of RubyGems
  2. Ran sudo gem install rails --include-dependencies
  3. 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:

  1. Install XCode
  2. Install Homebrew
    1. Install MySQL, Postgres, Image Magick, etc. (brew install mysql, etc.)
  3. Install RVM
    1. Install Ruby 1.9.2 (rvm install 1.9.2)
    2. Switch to default (rvm 1.9.2 --default)
    3. Install Rails (gem install rails)
    4. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM