Getting rails 4 up and running with rbenv on Ubuntu 13.10

Tim Abell · December 4, 2013

Reading time: 1 minute

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
  • git clone ~/.rbenv
  • Install ruby-build to manage installation of ruby versions into rbenv
  • git clone ~/.rbenv/plugins/ruby-build
  • For convenience install dotmatrix - this will set up the rbenv environment correctly, amongst other things
  • clone
  • 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
  • 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:
  • 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 improvements: page source on github

Get extra content that's just for my list. Get new blog posts to your inbox.
Join me on my journey through software and business.