Aptana to start WEBrick

Tony picture Tony · Dec 26, 2011 · Viewed 7.1k times · Source

How can I configure Aptana to start webrick server on a Ruby On Rails project?

I used the option "Promote to project" to open an existing rails project using aptana. I don't know how to configure (and start) my webrick server within Aptana.

Answer

craig.kaminsky picture craig.kaminsky · Dec 26, 2011

This response assumes you are using Aptana Studio 3 (or its mobile counterpart, Titanium Studio). I was not certain what version of Aptana you are using based on the original post.

Aptana uses WEBrick as the default Rails server. To fire up your server, first select your project from the list/drop-down in the App Explorer view (if this view is not visible, use Window -> Show View -> App Explorer to display it).

With the project now active in your App Explorer, click on the Commands icon (looks like a blue sprocket), also part of the App Explorer view, and do either of the following options:

  1. Select "Run Server" as this will automatically open a terminal view and run the rails server command, which will start WEBrick.
  2. Select "Open Terminal" and then, once the Terminal view opens, type: script/rails server

*If you want to use a server other than WEBrick, that's easy to do.

For myself, I use thin locally because my Rails apps are deployed to Heroku and that's what is used on their servers. So, in my Gemfile I add: gem 'thin' and then run bundle install from the Terminal.

From there, I use option 2 (above) but I type "script/rails server thin" in the Terminal so that it starts up the thin web server rather than the default of WEBrick.