Update 2013-03-18: These instructions also worked well on a Linux Mint 14 box (which is based on Ubuntu 12.10)
I just setup a fresh VM with Ubuntu 12.04, and I wanted to setup Ruby on Rails on the machine right off the bat.
I followed this “Installing Ruby on Rails on Ubuntu 12.04” guide from The Tech Journal, which worked very well, except I had to make a couple of changes in the instructions, which you can see in my notes below:
Again, here’s the guide I followed :
Better way of installing RVM:
I had a little trouble installing RVM per the instructions in the above post, so, I followed the basic install instructions directly from the full RVM site:
Install RVM/Ruby dependencies:
Next, from the terminal window, type:rvm requirementsRVM will show you a list of dependencies that need to be installed. So, run the sudo apt-get commands shown (copy and paste them in the terminal window) to prepare the environment for rvm, ruby, rails development.
Install a version of Ruby:
rvm install <ruby_version>
I can’t tell you which version(s) you’ll want or need, but this how you will install them.
You can get a list of available versions with this command:
rvm list known
You’re on you on from here…
Create a GemSet, then install Rails and any other gems your app needs. You’ll probably use the “bundle” command to pull in the required gems from a gemfile. From here on, it’s basic Rails stuff.
Other crap I’ve had to deal with if something goes wrong….
Oh, yeah, one more final point about (not) installing gem docs…
I always like to turn off the documentation downloads (rdoc and ri) when installing new gems (I never read the docs locally this way, I always use the web). You can make a permanent change on your system to *not* install gem documentation when installing new gems. Run this line in the terminal window:echo "gem: --no-rdoc --no-ri" > ~/.gemrc
This will create a .gemrc file in your home folder telling the gem installer not to download the docs when you install new gems. You only need to do this once.
Do this before you run any “gem install” commands, or use Bundler, so that it won’t waste time and space pulling down docs for the gems.
Other detailed instructions for installing a full Ruby, Rails, Apache, MySql stack
If you really want a LOOONG tutorial that also gets deep into installing Apahce, MySql, and all that jazz, check out this post which has a 35 page PDF mega walk-through.
Setting up RubyMine
If you want to install RubyMine IDE for your Rails development, you can follow my instructions here: http://mattslay.com/installing-rubymine-4-on-ubuntu-12-04/
Other goodies I installed on my new Ubuntu machine:
I installed these personal favorites right from the Ubuntu Software Center (I’ve listed links so you can learn more about these tools, but I recommend installing them through the Ubuntu Software Center right inside of Ubuntu):
- Krusader (A better File manager than the standard Ubuntu one)
- Konsole (A better Console/Terminal window that then the standard Ubuntu one)
- Tortoise HG Workbench (for Mercurial version control) (install via PPA to get latest version):
Note: Read the notes at the top of the page to install the PPA key for apt to work properly.
Also note that they recommend not installing Mercurial ahead of time. Let the TortoiseHG PPA handle that for you.
- gitg – Git repository browser/GUI
- XRDP – Remote Desktop Server: Access your new Ubuntu machine from Windows via Remote Desktop
- LuckyBackup – To create/schedule backups.
LuckyBackup tutorial here:
If you’ve got favorite Linux/Ubuntu tools that you think are helpful to Rails developers, please add them in the comments.