RubyFoo/Rails

From Chaosdorf Wiki
< RubyFoo
Revision as of 23:51, 23 October 2012 by Nomaster (talk | contribs) (first draft of RoR how-to)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Ruby on Rails Installation

Install Ruby

Use a recent Ruby version. Recent is 1.9.3 atm.

  • Debian: ruby1.9.3 (testing repo)
  • Arch: ruby
  • etc.

Set Environment Variables

Set a user specific gems dir (because of reasons) and the search path:

 $ mkdir $HOME/.gem
 $ export GEM_HOME=$HOME/.gem
 $ export PATH=$PATH:$HOME/.gem/bin

Remember to make these persistent!

Install Bundler Gem

Use the Bundler gem to manage dependencies for each project:

 $ gem install bundler

Go to the project directory and install specified gems:

 $ cd [PROJECT]
 $ bundle

Or, initialize a new Rails installation with the most recent version:

 $ bundle install rails
 $ rails new [PROJECT]