Here’s a link to a really complete post on preparing your Ubuntu machine for Rails development:
http://railsapps.github.io/installrubyonrails-ubuntu.html
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:
1 |
rvm requirements |
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:
1 |
<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:
1 |
<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:
1 |
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)
http://www.krusader.org/ - Konsole (A better Console/Terminal window that then the standard Ubuntu one)
http://kde.org/applications/system/konsole/ - Mercurial and TortoiseHg Workbench (install via PPA to get latest version):
https://launchpad.net/~tortoisehg-ppa/+archive/releases
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
- KDiff3
- XRDP – Remote Desktop Server: Access your new Ubuntu machine from Windows via Remote Desktop
http://www.xdrp.org - DropBox
- LuckyBackup – To create/schedule backups.
https://launchpad.net/ubuntu/+source/luckybackup
LuckyBackup tutorial here:
http://www.liberiangeek.net/2011/02/schedule-backup-luckybackup-ubuntu-10-10-maverick-meerkat/ - Use this PPA to install Sublime Text 3
https://launchpad.net/~webupd8team/+archive/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.
I’ve never used Konsole or Krusader… what’s better about them? Maybe that’s a scope for another blog post.
Look at the screenshots here and you can bascially tell..
http://www.krusader.org/
http://kde.org/applications/system/konsole/
I followed your blog to install rvm on a fresh Ubuntu 12.04 VirtualBox installation. I found that the commands in the “Second Change” section were necessary as well as the
chown
command in the “Finally” section.Great info, thanks for posting!
chown ( change owner ) with parameter -R (recursive), is used to change owner of the folder .rvm and all it content.
In this case, it bring access permissions to the [user]:[group].
Here is another instruction set:
http://www.rubypluspl.us/2012/06/ubuntu-1204-ruby-on-rails-development.html?utm_source=rubyweekly&utm_medium=email
I like konsole as well. You can just hit the button to open a new terminal, with buttons or tabs at the bottom to quickly switch to a different terminal. You can double-click the buttons/tabs and give them meaningful names. For example, for Rails, I’ll have one that says “models” that has vim with a couple model files open, and others for “controllers”, “helpers”, etc. Then I’ll have one that says “db”, which I’ll have a tmux session with windows panes for various databases.