Menu
I'm running Mac OS X v 10.4.11 and I want to install Xcode to compile and run ruby on rails. When I go to apple site I must download latest version of Xcode which does not run on my version of OS X. Where can I download a version of XCode that i can install in my environment. Can anyone provide me with a link? Let's look at the installation instructions for Rails' Framework on Windows, Mac OS X, and Linux. Rails Installation on Windows. First, let's check to see if you already have Ruby installed. Bring up a command prompt and type C: ruby -v. If Ruby responds, and if it shows a version number at or above 1.8.6, then type C: gem -version. Rails and its supporting cast of web servers and databases thrive on the rich Mac OS X environment. The premier text editor favored by legions of Rails programmers everywhere is TextMate, a Cocoa application. And all members of the Rails core development team work with Macs.
- Ruby On Rails Ide Mac Os X
- Ruby On Rails For Mac Os X 10.7
- Mac Os X 10.13
- Install Ruby Mac Os
- Mac Os X Iso
- Apple Mac Os X
- Ruby On Rails For Mac Os X El Capitan
(Related article: How to Install Ruby on Rails for Linux (Ubuntu))
Step 1. Upgrade Your System to OS X Mavericks
Installing Ruby on Rails is simple, but unless you have an old Mac machine (a pre ‘08 model), you should seriously consider upgrading your system to OS X Mavericks (10.9). It comes with the latest improvements from Apple, and it’s completely free! You can follow this guide for this upgrade.
Step 2. Install XCode Command Line Developer Tools
We need to first install Apple’s XCode Command Line Developer Tools, so that we can use the build tools and utilities that come with it to build Ruby gem native extensions and install other system packages.
This used to be a lengthy process, but if you are on Mavericks, all you have to do is to run this command in your terminal:
After the installation, type
and if the response has something like
Apple LLVM version 5.0
, you are all set.Step 3. Install Homebrew
Homebrew is the best package manager on Mac. If you are still using MacPorts, it’s time to start brewing! To install homebrew, use this one line installer:
After it finishes, type
you should see the response as
/usr/local/bin/brew
Step 4. Install Ruby with RBENV
Your Mac already ships with Ruby (we used it to install homebrew in the last step). However, it’s still a good idea to use a Ruby version manager because:
- the system Ruby is likely outdated and you may want to use the latest Ruby version to leverage the new features
- you may need to work on multiple projects on different Ruby Versions
RVM and RBENV are the two leading Ruby version managers. I prefer RBENV because it’s a simpler and lighter weight solution, and together with bundler, it solves the project gemset problem in a more elegant way.
We can just use homebrew to install rbenv.
rbenv by itself only manages switching ruby versions. ruby-build and rbenv-gem-rehash are both rbenv plugins. ruby-build allows you to install rubies with rbenv and rbenv-gem-rehash automatically hashes new gems for you when they are installed. You can see here to learn more about rbenv plugins.
You need to initialize rbenv by adding this line in your
~/.bashrc
file.Ruby On Rails Ide Mac Os X
Now you are ready to install Ruby with rbenv. At the time of this writing, the latest stable Ruby version is 2.1.0, so let’s install that.
Step 5. Install Git and Set Up Github Account
Git is the version control system of choice for the Ruby community. If you followed this guide, you should already have git installed as part of the XCode Command Line Developer Tools. You may also want to install git separately with homebrew for easier upgrading.
Now tell git your name and email that it will use for your commits.
Github is the leading platform for source code hosting and collaboration. If you don’t have an account yet, go ahead and sign up for one at https://github.com. Make sure you sign up with the same email address from the step above.
For easier authentication with Github when you push or pull code, follow this guide to set up ssh keys for your Mac.
Step 6. Create a New Rails Application
If you don’t have a directory to hold all your development projects yet, you can create that directory like below:
Now you can create a Rails project in that directory:
Wait until the the last step finishes, and you just created your first Rails project! You can verify that you set up Rails by first starting the server
Now open up your browser and type in the address bar
http://localhost:3000
and if you see a welcome page, your app is running locally.Step 7. Set Up Sublime Text as Code Editor
If you already have an editor of choice, such as Vim or Emacs, you can skip this step. :) If you are not familiar with code editors, Sublime Text is an excellent choice and you can download it here.
After you install it, run the following command:
Ruby On Rails For Mac Os X 10.7
and now you can simply type
in your Rails project directory to start coding.
The convention for Ruby programs is to use two spaces as indentation. You can follow
Sublime Text 2 => Preferences => Settings - User
and add these lines.Optional Step 1. Use iTerm 2, zsh and oh-my-zsh to set up an awesome terminal
Download and Install iTerm 2. It comes with more features and is easier to customize than the built in Terminal.
Now it’s time to customize your terminal! Here are some of my preferences.
- Under “General”, check “Copy to clipboard on selection”
- Under “Profile” => “Colors”, click on “Load Presets”, then choose “Dark Background”
- Under “Profile” => “Text”, change the font to one that you enjoy looking at. My favorite is 20pt Anonymous Pro with Anti-aliased. You have to download it first and install it into your Mac’s font book before you can use it
- Under “Keys”, define a hotkey to hide/show the terminal window. This is much faster than having to Command+Tab through opened windows and find iTerm 2
Zsh is an alternative shell to the default bash shell that comes with Mac. It adds nice features such as smart tab completions, but what really sets it apart is its scriptability. Together with oh-my-zsh, an open source zsh configuration management framework, it becomes really easy to customize both the look and functionality of your terminal.
Your Mac already comes with zsh. To use zsh, go to iTerm 2 => Preferences => Profiles => General and in the “Command” section, select “Command”, and type
/bin/zsh
in the box after it. Now close your terminal and relaunch it, you should be on zsh!Next, let’s install oh-my-zsh:
Now you can customize the
~/.zshrc
file.- If you have your settings in
~/.bash_profile
, you may want to copy them over to/.zshrc
. - Find the
plugins=(git)
line and add more plugins. Here is the plugins I am using:
If you do not like the default theme, you can pick from one of the many themes that come with oh-my-zsh. You can see the list of themes here and here.
If you feel really adventurous, you can even build your own theme! Take a look at how themes are implemented, and copy/tweak/build one exactly to your taste!
Optional step 2. Install Postgresql as a production quality database
By default, Rails uses sqlite3 as the default development database. It’s a nice database but probably not one that you want to use in production. Postgresql is a solid, production quality relational database and works well with Rails. It’s generally a good idea to set up your local database to match the database on the production environment.
The easiest way to use Postgresql on Mac is to download and install the Postgres.app
With Postgresql running, add
gem 'pg'
to the Gemfile in your rails project and run bundle install
to install the Postgresql Ruby driver. This RailsCast talks about how to set up with Postgres in detail. Microsoft publisher download for mac. You can skip the “taps” part if you don’t already have data that needs to be migrated.Congratulations!
This is it! You just made it to the end of our first rails tutorial, and have now set up your local Ruby on Rails development environment like a pro, now it’s time to start coding. :)
- Learning Ruby on Rails
- Advanced Ruby on Rails 2.1
- Advanced Ruby on Rails 2.1
- Quick Reference Guide
- Ruby on Rails 2.1 Useful Resources
Mac Os X 10.13
- Selected Reading
Install Ruby Mac Os
To develop a web application using Ruby on Rails Framework, you would need to install the following software −
- Ruby
- The Rails framework
- A Web Server
- A Database System
We assume that you already have installed a Web Server and Database System on your computer. You can always use the WEBrick Web Server, which comes with standard installation of Ruby. Most sites, however, use Apache or lightTPD in production.
Rails works with many database systems, including MySQL, PostgreSQL, SQLite, Oracle, DB2 and SQL Server. Please refer to a corresponding Database System Setup manual to setup your database.
Let's look at the installation instructions for Rails' Framework on Windows, Mac OS X, and Linux.
Rails Installation on Windows
First, let's check to see if you already have Ruby installed. Bring up a command prompt and type C:> ruby -v. If Ruby responds, and if it shows a version number at or above 1.8.6, then type C:> gem --version. If you don't get an error, skip to step 3. Otherwise, we'll do a fresh installation for Ruby.
- If Ruby is not installed, then download an installation package from rubyinstaller.rubyforge.org.Follow the download link, and run the resulting installer. This is an exe like ruby186-25.exe and will be installed in a single click. You may as well install everything. It's a very small package, and you'll get RubyGems as well along with this package.
- With RubyGems loaded, you can install all of Rails and its dependencies through the command line −
The above command may take some time to install all dependencies. Make sure you are connected to the internet while installing gems dependencies.
Congratulations! You are now on Rails over Windows.
![Apple mac os x Apple mac os x](/uploads/1/1/1/8/111805537/751463311.jpg)
Mac Os X Iso
NOTE − In case you face any problem with the above installation, there are chances that you may not have the latest versions of Ruby or other Gems. So just issue the following command and you will have everything updated automatically.
Then try above command with updated gems.
Apple Mac Os X
Rails Installation on Mac OS X
- First, let's check to see if you already have Ruby installed. Bring up a command prompt and type $ ruby -v. If Ruby responds, and if it shows a version number at or above 1.8.6 then skip to step 3. Otherwise, we'll do a fresh installation for Ruby. To install a fresh copy of Ruby, the Unix instructions that follow should help.
- Ntfs for mac processing please wait. Next, you have to install RubyGems. Go to rubygems.rubyforge.org and follow the download link. OS X will typically unpack the archive file for you, so all you have to do is navigate to the downloaded directory and (in the Terminal application) type the following −
- Now, use RubyGems to install Rails. Issue the following command.
The above command may take some time to install all dependencies. Make sure you are connected to the internet while installing gems dependencies.
Congratulations! You are now on Rails over Mac OS X.
Ruby On Rails For Mac Os X El Capitan
NOTE − In case you face any problem with above installation, there are chances that you may not have the latest versions of Ruby or other Gems. So just issue the following command and you will have everything updated automatically.
Then try the above command with updated gems.
Rails Installation on Linux
- First, let's check to see if you already have Ruby installed. Bring up a command prompt and type $ ruby -v. If Ruby responds, and if it shows a version number at or above 1.8.6, then skip to step 5. Otherwise, we'll do a fresh installation for Ruby.
- Download ruby-x.y.z.tar.gz from www.ruby-lang.org
- Untar the distribution, and enter the top-level directory.
- Do the usual open-source build as follows −
- Install RubyGems. Go to rubygems.rubyforge.org, and follow the download link. Once you have the file locally, enter the following at your command prompt −
- Now use RubyGems to install Rails. Still in the shell, issue the following command.
The above command may take some time to install all dependencies. Make sure you are connected to the internet while installing gems dependencies.
Congratulations! You are now on Rails over Linux.
NOTE − In case you face any problem with above installation, there are chances that you may not have the latest versions of Ruby or other Gems. So, just issue the following command and you will have everything updated automatically.
Then try the above command with updated gems.
Keeping Rails Up-to-Date
Assuming you have installed Rails using RubyGems, keeping it up-to-date is relatively easy. Issue the following command −
This will automatically update your Rails installation. The next time you restart your application, it will pick up this latest version of Rails. While giving this command, make sure you are connected to the internet.
Installation Verification
You can verify if everything is setup according to your requirements or not. Use the following command to create a demo project in Rails environment.
This will create a demo rails' project using SQLite database. Note that Rails uses SQLite as its default database.
We can create an application that will use MySQL database. Assuming you have MySQL database setup on your machine, issue the following command to create an application that will use MySQL database −
We will discuss the database setup part in subsequent chapters. Currently we have to check if our environment is setup properly or not. Use the following commands to run WEBrick web server on your machine −
Now open your browser and type the following address text box.
You should receive a message like 'Welcome aboard' or 'Congratulations'.
How to Upgrade?
If you are already running an old version of Rails, then here is the procedure to upgrade it to the latest version 2.1 −
- If you want to move your application to Rails 2.0, you should first move it to Rails 1.2.6.
- If your application runs fine on 1.2.6 with no deprecation warnings, there's a good chance that it'll run straight up on 2.0.
- To complete the upgrade, you would have to upgrade your extractions. If you are using pagination, you will need to install the classic_pagination plugin. If you are using Oracle, you will need to install the activerecordoracle-adapter gem.