ruby-on-railsconfigurationaptanaaptana3

How do I create a Rails run configuration on Aptana Studio 3?


I'm using Aptana Studio 3 on Mac OS X (High Sierra). I have imported my Ruby on Rails project. My Project Natures are set up like this

enter image description here

I want to set up my Rails server so I can run it from the IDE (or debug with it). Oddly, the Run/Debug settings only include PHP ...

enter image description here

So how do I create a run configruation to run my server? When I right click my project, select "Run As" -> "Run Configurations", I see a screen like this. Not sure if this is the right screen to configure things or how to do it ...

enter image description here


Solution

  • You can run your server creating a run configuration or just creating a new Rails Server.

    Creating a Run Configuration

    In "Run Configurations" options, select Ruby Applications > New_configuration and then click in "Browse...". Type 'rails' to search for the rails file and select it inside "Matching resources". Click "Ok".

    enter image description here

    Then go to Tab "Arguments", set the working directory as the root folder of your project, and inside "Program Arguments" put the value "server" and click "Apply".

    enter image description here

    Now you can run or debug your application.

    Creating a Rails Server

    Go to Windows > Preferences > Aptana Studio > Web Servers and click in "New...".

    enter image description here

    Then select the option "Rails Server", choose the name of your server and click "Ok". If your project nature was not set to "Rails" the option "Project" would be empty here, and you would need to set the Rails nature first.

    enter image description here

    If you try to run the server like this you will receive an error telling that the program ".../script/rails" does not exist, so first you need to create a folder named "script" inside your project and paste the file "bin/rails" inside it (as explained here).

    Now just click with the Right mouse button in your project and select "Run server".