Getting rails 4 up and running with rbenv on Ubuntu 13.10

Tim Abell · December 4, 2013

Brain dump warning!

This is a follow up to Installing ruby 2 + Rails 4 on Ubuntu 12.04 LTS and is just a list of steps needed to get a clean install of Ubuntu up to speed with an existing site.

  • Install rbenv to manage ruby versions
  • https://github.com/sj26/rbenv-install
  • git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
  • Install ruby-build to manage installation of ruby versions into rbenv
  • https://github.com/sstephenson/ruby-build
  • git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
  • For convenience install dotmatrix - this will set up the rbenv environment correctly, amongst other things
  • clone https://github.com/timabell/dotmatrix
  • run bin/install
  • restart any running terminal(s) to get rbenv
  • get a project (includes a .ruby-version file for rbenv, and a Gemfile for bundle)
  • git clone git@github.com:timabell/symbol-library.git
  • sudo apt-get install libssl-dev libreadline-dev
  • readline is needed for rails console, and has to be installed before ruby. If you’ve already installed ruby then just re-run rbenv install and it will overwrite the existing build with a version with readline support. ref: http://vvv.tobiassjosten.net/ruby/readline-in-ruby-with-rbenv/
  • rbenv install x.x.x-xxxx
  • autocompletes, yay!
  • .. or better still reads from .ruby-version I think so you can just run rbenv install if you are in the project folder
  • gem install bundler
  • from the right directory so done for right ruby version
    • rbenv rehash
  • bundle
  • will install all the gems for the project
  • don’t sudo apt-get install rbenv ~ doesn’t provide sufficiently up to date ruby
  • don’t gem install rails --version 4.0.2 --no-ri --no-rdoc ~ don’t need this when you have a gem file with rails in it, bundle will do it for you
  • sudo apt-get install nodejs
  • for javascript runtime (rails server throwing an error without this)
  • bundle exec rails server
  • bundle exec rails console
  • needs readline (see above)

Other stuff I like in my install

This is mostly for my own reference but maybe it’ll help someone else out.

Share: Tweet | LinkedIn
Suggest improvments: page source on github
If you liked this post then sign up to my mailing list: