简体   繁体   中英

Installing Rails on Mac os X 10.6.8?

I'm new in Ruby on Rails, I'm trying to install rails on mac os x 10.6.8 (i already have ruby: ruby 1.8.7 (2010-01-10 patchlevel 249) [universal-darwin10.0] ), but when I try to see the rails version installed using $ rails -v , I get:

rails is not currently installed on this system. To get the latest version, simply type:

I tried to run:

$ sudo gem install rails

You can then rerun your "rails" command.

Of course i tryed to type sudo gem install rails and others options too but no solution, also i tryed to install rvm, this is what i have:

$ rvm -v

rvm 1.13.0 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

how can i do to make it work together? or what can i do to fix the problem?

Ok I am looking at the instructions here: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book#sec:up_and_running

From your comments you do not have the correct version of ruby installed on your system.

rvm get head && rvm reload
rvm install 1.9.3
rvm use 1.9.3@current --create --default 

The last line creates a gem set called current .

Now check to make sure you RubyGems was installed correctly by typing which gem in your terminal. Now update your gems.

gem update --system 1.8.24

Finally install rails.

gem install rails -v 3.2.3

I hope this works, let me know if you have any issues.

I was having the same problem when running OSX 10.7.4. I solved it with the following approach.

Identify the gem manager you're using:

$ which gem 
/Users/peter/.rvm/ruby-1.9.2-p320/bin/gem

Then do a gem update for that specific version:

$ gem update --system 1.9.2

This took ages to complete, but once finished, rails -v returns:

Rails 3.2.8

Admittedly life shouldn't be this hard. Although I'm used to command line stuff, I'd love to see a graphical tool that allows you to mix, match and confirm what Ruby/Gems are installed on your system.

I hope this helps.

I've had great luck using the Rails Ready script on OSX. Can't say about Lion from personal experience but its always worked great on Snow Leopard.

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