Error is raised if mongodb isn't running/installed.

bundle exec rails g locomotive:install
/Users/iMac/.rvm/gems/ruby-1.9.3-p194/gems/mongo-1.5.2/lib/mongo/connection.rb:413:in `connect': Failed to connect to a master node at localhost:27017 (Mongo::ConnectionFailure)