04 December 2013

Getting rails 4 up and running with rbenv on Ubuntu 13.10

Brain dump warning!

This is a follow up to http://timwise.blogspot.co.uk/2013/05/installing-ruby-2-rails-4-on-ubuntu.html and is just a list of steps needed to get a clean install of Ubuntu up to speed with an existing site.
  • 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
  • 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
  • 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.