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
    <li>You will now need to install some plugins</li>
    
    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/
      <li>Make sure all of the new items are selected, and click "Finish"</li>
      <li>Some updates will come up. Select them all and click "Next"</li>
      <li>Several Licensing questions may come up. Accept the terms of the licensing agreements and click "Next"</li>
      <li>A list of features to be installed will appear. Click "Finish"</li>
      <li>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.</li>
      <li>When Eclipse is done installing, it will ask you to restart Eclipse. Do so.</li>
      <li>Congrats. You are done.</li>
      


  2. 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"
      <li>Go to Ruby->Installed Interpreters</li>
      
      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.
      <li>Go to Ruby->Ri/rdoc</li>
      
      1. If either of the two is missing, add the binary (in Windows, it might be a .bat file)
      <li>Go to Rails->Configuration</li>
      
      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.
      <li>Go to General->Editors->Text Editors and set your desired tab width</li>
      <li>Go to Ruby->Formatter.</li>
      
      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.
      <li>Click Rails->Editors->RHTML Editor</li>
      
      1. Choose your desired tab settings
      <li>Go to Aptana->Editors</li>
      
      1. Choose your desired tab settings under "Formatting"


  3. 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!