M
M
mystdeim2016-04-04 11:30:35
Ruby on Rails
mystdeim, 2016-04-04 11:30:35

How to run a Rails console on a production server?

I go via ssh to the production in the ~/app/current directory, I try to run: It
bundle exec rails c RAILS_ENV=production
gives a standard help like:

Usage:
  rails new APP_PATH [options]

Options:
  -r, [--ruby=PATH]

Rails version 4.2
It seemed to work before, but now it does not see that the application is installed in this directory, how can I start the console?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene Burmakin, 2016-04-04
@mystdeim

rvm:
rbenv:
RAILS_ENV=production bundle exec rails c

A
Andrey Andreev, 2016-04-04
@b0nn1e

Most likely you have not added bin files to the repository.
One-time try to solve the problem like this - in the current folder on the production server:
And then start the console
Or run it locally bundle exec rake rails:update:bin, add the files and the bin folder to the repository (check your .gitingore).
Deploy and then try to launch the console.
You can also add the gem https://github.com/ydkn/capistrano-rails-console for quick access to the console.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question