“When it comes to Web Development via Ruby on Rails, I prefer working with the Mac OS X.”
OS X makes it so easy for setting up Ruby on Rails development environment; but I still observe other junior developers having troubles with setting it up.
Seven simple steps!
1. First of all, Mac OS X provides Xcode and Xcode Command Line Tools which are development tools. You can download them from the Apple Developer site.
2. Then, install homebrew: ruby -e “$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)“. After the installation, run “brew doctor” to make sure homebrew works fine. If not, follow the instructions of the message that appears.
3. Install GCC 4.2 by inputting “brew install apple-gcc42” & “sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2“.
4. Install RVM with “curl -L https://get.rvm.io | bash -s stable –autolibs=enabled”
5. Install Ruby 2.0.0: “rvm install 2.0.0 –default” (or any other version: “rvm install “version”).
6. Lastly, install Rails(and the bundler): “gem install rails bundler –no-ri –no-rdoc”
7. Tip: If have any errors about missing libraries then just search on google about the libraries associated with the error and then execute: “brew install [library-name]”
1. Will you be uploading your code to Github? Install git with: “brew install git”
2. Will you be working with SQLite3? Install it with: “brew install sqlite3”
3. Will you be working with MySQL? Install it with: “brew install mysql”
4. Will you be working with PostgreSQL? Install it with: “brew install postgresql”