Search code examples
ruby-on-railsnginxrvmthin

How do I setup multiple rails applications for development?


For the site I am currently working on we have 2 Rails 3.2 projects. One project is basically an API, and the other is a web front end. In order to develop on the web front end I need to have the API project running. I've tried using the foreman and subcontractor gems to manage this but it doesn't seem to work. Both projects run the Thin application server and have their own RVM gemsets. We also run Nginx in production.

How would you go about managing this setup for development? I want there to be 1 command to fire up everything, similar to how Foreman works.

Requirements:

  • RVM Support
  • Thin for development
  • One command I can run from the API application to start both applications
  • Cannot using Pow (it always seems to get hung up and is incredibly slow)
  • Setup should work for other developers with minimal setup (easily scriptable)
  • Works on OSX

Thanks!


Solution

  • tmuxinator allows you to easily configure a tmux session that can be launched with a single command containing any number of windows (tabs) and executes commands in each window (like starting a server). Just configure it to load the appropriate gemset for the appropriate rails server.

    https://github.com/aziz/tmuxinator