开发者

Where specifically should I download Ruby and Ruby on Rails on Mac 10.6.4?

Where should I go开发者_开发技巧 to download it. What exactly do I need. What should I do to install it?


Both Ruby and Ruby on Rails are already installed on Snow Leopard. You can see the ruby version by running

$ ruby --version

However, Snow Leopard has a very old Rails version and a quite outdated Ruby version. I suggest you to install RVM and use it to install Ruby 1.9.2 and Rails 3.


Here are the directions that I use:

1) install the apple developer tools (ie Xcode).

You can find XCode on the "Mac OS Install DVD" that came with your laptop. If you don't have this disk, you can download it from apple developer tools. It is over 2 gigs, so go get a cup of coffee. Why do we install this The Ruby on Rails version shipped with OS X is a production version of Ruby and does not include the ruby headers. Because you will want to use a debugger, you will want to install apple developer tools.

2) install rvm

RVM allows you to have multiple versions of ruby on your system and the same time and quickly switch between them. We'll use it because it provides a nice abstraction layer.

  • source for these directions: http://rvm.beginrescueend.com/rvm/install/
  • on the command line, type "bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-latest )"
  • Once it is finished, it will ask you to do several things.
  • On my machine, I put the following line at the end of my .profile -- on a new machine you might not yet have a .profile file. In your terminal window, type vi .profile,

    • to insert code type "i"
    • to exit editing mode hit the escape key
    • to save and quit type ":wq"
    • "[[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm"
  • Kill all open terminal windows
  • Validate that you have rvm installed properly, start a new terminal window and type "type rvm | head -n1" -- you should see "rvm is a function"

3) install ruby (feel free to pick a different version of ruby than this one)

from the command line type "rvm install ruby-1.8.7-p302" * From a terminal window type "rvm --default ruby-1.8.7-p302" * Type "rvm list", you should see "=> ruby-1.8.7-p302 [ x86_64 ]" 3)

4) update ruby gem manager

from the command line type "sudo gem update --system"

5) instal rails

"gem install rails -v 3.0.4 --no-rdoc --no-ri"

6) install mongrel

In a terminal window, type "gem install mongrel"

7) install bundler

from a terminal window, type "gem install bundler"

8) getting started

You may want to read Michael Hartl's online tutorial. http://ruby.railstutorial.org/


You could do: (on a Terminal)

sudo gem update --system

Then :

gem install rails
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜