Rails console not working on server

Erwin Rooijakkers picture Erwin Rooijakkers · Sep 7, 2014 · Viewed 16.2k times · Source

When I run bundle exec rails console production or rails console production via SSH on the server in the Current folder of the Capistrano deploy I get:

Usage:
     rails new APP_PATH [options]

Options:
    (...)

with an explanation to start a new app. Locally it works. Why can't I start a console remotely?

Answer

user3453503 picture user3453503 · Sep 7, 2014

I'm assuming that you updated to rails 4 from version 3 and your app can't find the executables in the bin directory. Run this to see your rails version:

$ rails -v

If your rails version is 4 or above, try running this:

$ rake rails:update:bin

Source: Rails 4 Release Notes

6.1 Notable changes

  • Your app's executables now live in the bin/ dir. Run rake rails:update:bin to get bin/bundle, bin/rails, and bin/rake.