Download Ruby On Rails For Mac Os X
Basically, what we’re going to do here is download a bunch of open-source tools (some of which rely upon each other to work), configure them, compile them, and install them, one by one, until we have everything we need for a Mac OS X machine to run Ruby on Rails. What’s Needed. A few things are needed to get this going. Step 5: Install RVM with the latest Ruby (2.2.0) and Rails (4.2.0) RVM stands for Ruby Version Manager, and is one of the most popular tools that allow you to install and manage multiple versions of Ruby and Rails on the same computer. RVM has come a long way since I originally published this tutorial.
The programming projects for this class require you to use Ruby 2.1.4 and Rails 4.1.7. If you don't already have these packages installed on your laptop, follow the instructions below to install them. The installation process is different depending on whether you are running Windows, MacOS, or Linux:
Windows
- There is an all-in-one installer available at http://railsinstaller.org/. Click on the large 'Download Kit' button and follow the instructions. This will install Ruby, Rails, Sqlite, plus a few other things such as git.
- Once the installer has completed, open a command window and type the following command to upgrade to Rails 4.1.7:
Mac OS X
- Recent versions of Mac OS X have Ruby and Rails installed by default, but you will need to upgrade to version 2.1.4 of Ruby and version 4.1.7 of Rails.
- To get started, you will need to install XCode, but note that you will NOT be developing in XCode, you just need to have it installed. You can grab the dmg file here: http://developer.apple.com/technology/xcode.html. We recommend the iPhone version if you have any interest in doing iPhone dev at any point. Also, you'll have to sign up for a free ADC account to download XCode.
- If you are running Mavericks, you can use a simpler approach to installing XCode, which will install a lot less junk on your machine. Instead of following the instructions above, open a shell window and enter the following command: A popup window will appear asking for permission to install; go ahead with that. After installation completes, exit the shell window (e.g. CMD+Q) and start a new shell window; use that new window for the rest of the commands below.
- Check your version of Ruby by typing '
ruby -v'
in a shell window. If you are not running version 2.1.4, you will first have to installrvm
, then use it to upgrade Ruby. To installrvm
, follow the instructions at https://rvm.io/rvm/install/. Oncervm
is installed, upgrade Ruby with the following shell commands: - Once you are running Ruby 2.1.4, you can upgrade to Rails 4.1.7 with the following command:
- Install Sqlite3. Mac OS X should already have Sqlite3 pre-installed, so all you need to do is install the Ruby connector: This may print out several warning messages, which you can ignore. If this prints error messages, it may be that you don't have Sqlite3 pre-installed; Google 'sqlite3 install macos' to find out how to install it.
Linux
We don't officially support Linux for this class, so you will be mostly on your own if you want to use it. However, we think the following instructions may work:
- Check to see if Ruby is already installed with the correct version by typing '
ruby -v'
. If it prints version 2.1.4 then you can skip the next few steps. - Install
rvm
by following the instructions at https://rvm.io/rvm/install/. This page gives several possible commands for installingrvm
; we recommend the following command: - Once
rvm
is installed, invoke the following shell commands, which will upgrade Ruby to 2.1.4 and make that the default version of Ruby on your machine. - Once you are running Ruby 2.1.4, you can upgrade to Rails 4.1.7 with the following command:
- Install Sqlite3. Download the file
sqlite-3.7.0.1.so
and copy it to the directory containing the Ruby executable. Then use the Gem system to install the Ruby connector: This may print out several warning messages, which you can ignore. - Some Linux distributions come with Ruby 2.1.4 already installed. You can use this to skip some of the installation steps above, but if you do this, you may need to run some of the other installation commands above using
sudo
(e.g. 'sudo gem install rails -v 4.1.7
' instead of 'gem install rails -v 4.1.7
') - If you use
apt-get
to install packages, you may also need to usesudo
in some of the commands above. - When using a GUI terminal to run
rvm
properly, you should set the terminal as a login shell; see https://rvm.io/integration/gnome-terminal for instructions. - Installations can take quite a bit of time (several minutes) before showing any output.
# This is a guide for how I installed rails 3.1 on a clean install of Mac OS X 10.7 Lion. |
# There is no Warranty expressed, and I am not responsible for any issues that may arise from following this guide. |
# Installing rails should be simple. I cringed at other peoples methods shared via Twitter. |
# Keil Miller July 26, 2011 |
# Install RVM |
$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) |
# Load RVM into new shells |
# As instructed from the above command, add the line stated to the very bottom of the following file |
/etc/bashrc |
# Confirm RVM is loaded in new shell |
$ rvm -v |
# Install ruby 1.9.2 |
$ rvm install ruby-1.9.2-p290 |
# Tell rvm to use ruby 1.9.2 as default |
$ rvm --default use 1.9.2 |
# Create a new gemset for Rails 3.1 pre-release |
$ rvm 1.9.2@rails3.1-pre --create |
# Confirm that your new gemset exists |
$ rvm gemset list |
# Update rake to 0.9.2 or newer |
# It is important that you do this before installing rails |
$ gem update rake |
# Install Rails 3.1 pre-release |
$ gem install rails --pre |
# Confirm installed gems |
$ gem list |
commented Sep 4, 2011
rmv -v => rvm -v |
commented Sep 4, 2011
commented Jan 4, 2012
Install Ruby On Rails Mac
What do you mean by 'As instructed from the above command, add the line stated to the very bottom of the following file' |
commented Jan 4, 2012
Mac Os X For Pc
@corbinan571 Follow the step # Install RVM. It will yield directions in the terminal after it is done installing RVM, and should make sense at that point. I'll probably make a screencast soon and link it here. Any issues, leave a comment. |