Here’s a link to a really complete post on preparing your Ubuntu machine for Rails development:
The above link by the awesome Daniel Kehoe should be all you need to get Rails running on your Ubuntu machine, but I’ve left the information below as a record of how I previously prepared my Ubuntu machines for Rails development. As of 2013-03-18, these instructions also worked well on a new Linux Mint 14 install box (which is based on Ubuntu 12.10).
I mostly followed this guide “Installing Ruby on Rails on Ubuntu 12.04” from The Tech Journal, which worked very well, except for the RVM instructions did not work for me.
Since I had a trouble installing RVM per the instructions in the above post, I followed the basic install instructions directly from the full RVM site:
Install RVM/Ruby dependencies
Next, from the terminal window, type:
RVM 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:
<span style="font-family: Courier;">rvm install <ruby_version></span>
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:
<span style="font-family: Courier;">rvm list known</span>
You’re on you on from here…
Create a RVM gemset, then install your desired Rails version 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)
- Mercurial and TortoiseHg Workbench (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:
- Use this PPA to install Sublime Text 3
If you’ve got favorite Linux/Ubuntu tools that you think are helpful to Rails developers, please add them in the comments.