How to start multiple rails projects just by one command

If you do serious Rails programming, you may have multiple projects for your application. For example you may have one project for an API and another for a web UI. You might also use some background processing like sidekiq etc. Every time you need to launch these services on a development environment, you have to launch all projects in separate consoles manually.

Fortunately there is a better way to do it. By using a gem ‘subcontractor’ together with ‘foreman’ gem, you can define all the projects and services that you want to launch in the ‘Procfile’, for example:

Then you can launch all the projects and services just by one command:

foreman start

Mongoid and assets problem on Ruby on Rails 3.2

I was doing my first Ruby on Rails application with MongoDB (via Mongoid gem). When I deployed the application to a production server, assets were compiled correctly but all javascript and css links were still pointing to stylesheets and javascripts folders, like

<link href=”/stylesheets/application.css” media=”screen” rel=”stylesheet” type=”text/css” />

I checked capistrano and server configurations, but nothing were wrong there. Finally I figured out what was causing the problem. I have not required “sprockets/railtie” in the config/application.rb

In the Mongoid documentation especially in ‘Configuration’ section is ‘Getting Rid of Active Record’ subsection which says:

Open myapp/config/application.rb and near the top, remove the line require "rails/all" and add the following lines so you end up with this:

require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "rails/test_unit/railtie"
# require "sprockets/railtie" # Uncomment this line for Rails 3.1+

In a rush I only saw number 3.1 and thought it is okay to leave it as uncommented. Current Rails version is 3.2.8 so should that line be uncommented as default on Mongoid documentation?