Getting rails 4 up and running with rbenv on Ubuntu 13.10

1 minute read (310 words)

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.


Tweet This || Post to LinkedIn || Page Source

Subscribe for updates on software development, contracting, side projects, blog posts and who knows what else. Read the archives for an idea of content.

Mailing list powered by the excellent buttondown.email.