rubyruby-on-rails-4sshrails-console

Rails console not working on server


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?


Solution

  • 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.