3

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.

Tony
  • 10,088
  • 20
  • 85
  • 139

2 Answers2

8

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.

craig.kaminsky
  • 5,588
  • 28
  • 31
  • Thanks. I was using Aptana Studio 3 – Tony Dec 26 '11 at 18:34
  • No problem! Had I read the tag, I would have known you were on Aptana 3 ... but, glad it was helpful :) – craig.kaminsky Dec 26 '11 at 18:38
  • Any tips to debug using Aptana 3? – Tony Dec 26 '11 at 18:42
  • 1
    Sorry for the lag in response, Tony...post-holiday slowness! Debugging from Aptana is pretty easy. The main thing is ensuring that the right gems are installed on your system. In Terminal, run the following command: gem list Then look for the main debug gems (your version numbers may vary, of course!): ruby-debug-base19 (0.11.25) ruby-debug-ide (0.4.16) With those installed, you only need to select "Debug Server" from the App Explorer (found under the previously mentioned Sprocket icon) or "Debug" from the Run menu. Just make sure the right project is selected in the app explorer view :)! – craig.kaminsky Dec 28 '11 at 18:40
  • Sweet!! Glad to hear it. And have a great New Year's, Tony! – craig.kaminsky Dec 28 '11 at 19:38
  • How do I run the server like this in debug mode? – Saad Rehman Shah Sep 14 '12 at 07:32
  • How do I run the server like this in debug mode? I dont see the Run or Debug option. So how to start in debug mode after opening the Terminal ? – jumpa Jan 28 '13 at 16:53
  • I upgraded my rails project from version 2 to 3. Aptana's "Run Server" used to call "/script/rails server" to run. With Rails 3 this causes an error because the new command should be "rails s". Is there a way to change the Aptana command für "Run Server"? – webDEVILopers Apr 17 '14 at 07:21
-1

I have done same step..But it showing me.

Missing the Rails 2.1.1 gem. Please gem install -v=2.1.1 rails, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.

Piyush Aghera
  • 965
  • 7
  • 13