Skip to content

Instantly share code, notes, and snippets.

@galori
Created August 23, 2012 06:21
Show Gist options
  • Save galori/3433354 to your computer and use it in GitHub Desktop.
Save galori/3433354 to your computer and use it in GitHub Desktop.
Rails on Ubuntu

Rails on Ubuntu

sudo-apt get install curl

install RVM based on instructions on RVM web site:

curl -L https://get.rvm.io | bash -s stable --ruby

open new terminal window / shell for RVM to take effect let RVM tell you what else you need to install:

rvm requirements

based on what rvm requirements said, I installed:

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config

reinstall ruby and set it up

rvm reinstall 1.9.3
rvm gemset create todo
rvm use 1.9.3@todo --default
gem install rails --no-rdoc --no-ri

make sure you have the right ruby and the right rails:

$ ruby --version
ruby 1.9.3p194 (2012-04-20 revision 35410) [i686-linux]
$ rails --version
Rails 3.2.8

thats it! You should be able to create a new rails app and run it

rails new todo
cd todo

workaround some wierd latest rails bug by adding this line to Gemfile

gem 'therubyracer' 

rerun bundler

bundle

generate a scaffold

rails g scaffold task name:string due_date:datetime completed:boolean

launch rails server

rails s

view your app in your web browser at http://localhost:3000/tasks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment