2 min read

My Preferred Rails Development Environment

I've been chatting with a bunch of new Rails guys lately, and have been recommending my particular mix of Eclipse, RDT, RadRails, Subclipse, and Aptana as a basic IDE for new guys.

It occurred to me that there's no one-stop shop for instructions on how to do that, so here goes.

  1. Download Eclipse
    1. You will need to download the version for your particular environment (Win32, OSX, Linux)
    2. Extract the zip file you downloaded into someplace you use for program files
    3. Run Eclipse
  2. You will now need to install some plugins
    1. In Eclipse, go to Help->Updates->Find and Install
    2. Select "Search for new features to install" and click Next
    3. Click "New Remote Site" and add each of the following plugins:
      1. Eclipse plugins use "update sites," which provide all of the information for updates to the software after initial installation.
      2. RadRails: http://radrails.sourceforge.net/update
      3. RDT: http://updatesite.rubypeople.org/release
      4. SubClipse: http://subclipse.tigris.org/update_1.0.x
      5. Aptana: http://update.aptana.com/install/
    4. Make sure all of the new items are selected, and click "Finish"
    5. Some updates will come up. Select them all and click "Next"
    6. Several Licensing questions may come up. Accept the terms of the licensing agreements and click "Next"
    7. A list of features to be installed will appear. Click "Finish"
    8. Eclipse will download all of the features and install them. It will then ask you to verify any features that have not been "signed." Accept all features.
    9. When Eclipse is done installing, it will ask you to restart Eclipse. Do so.
    10. Congrats. You are done.
  3. You may need to do some additional configuration.
    1. Go to Window->Preferences
    2. Go to General->Editors->File Associations
      1. Make sure the default editor for "htm" and "html" is "Aptana HTML Editor"
      2. Make sure the default editor for "js" is "Aptana JS Editor"
      3. Make sure the default editor for "css" is "Aptana CSS Editor"
      4. Make sure the default editor for "rb" is "Ruby Editor"
      5. Make sure the default editor for "rhtml" is "RHTML Editor"
      6. Make sure the default editor for "yml" is "YML Editor"
    3. Go to Ruby->Installed Interpreters
      1. Make sure there is an entry there.
      2. If not, click "Add" and find your ruby binary (it might be in /local/bin or /opt/local/bin)
      3. NOTE: It does not matter what name you give this. You just need to point it to the binary.
    4. Go to Ruby->Ri/rdoc
      1. If either of the two is missing, add the binary (in Windows, it might be a .bat file)
    5. Go to Rails->Configuration
      1. Make sure Rails and Rake both have entries. Otherwise, add them (the ones in the main bin directory may not work. I needed to use /opt/local/lib/ruby/gems/1.8/gems/rails-1.1.6/bin/rails, for instance). If you go this route, make sure to change the path to your binaries if you upgrade.
      2. If you plan to use Mongrel with the built-in IDE, make sure there's an entry in the Mongrel path.
    6. Go to General->Editors->Text Editors and set your desired tab width
    7. Go to Ruby->Formatter.
      1. Click "Show" next to Eclipse [built-in]
      2. Select your desired tab policy
      3. Click Ok and select a new name for your formatting settings.
      4. Click Ok.
    8. Click Rails->Editors->RHTML Editor
      1. Choose your desired tab settings
    9. Go to Aptana->Editors
      1. Choose your desired tab settings under "Formatting"
  4. Your basic settings should now work.
I know the above sounds like a lot of work, but it's not. Besides, most of the settings are good from the beginning. If you choose to go this route (and I hope you will), make sure to install Dr. Nic's RadRails Templates, which make all of the pretty TextMate shortcuts (warning: PDF) work in Eclipse.

Happy Hacking!

Update: Digg it!