Heroku rails console does not start any more

后端 未结 5 595
北海茫月
北海茫月 2021-02-05 06:36

I have an issue with running the rails console at heroku (cedar-stack). Each of the following commands heroku run console, heroku run rails console, heroku run bundle exec rails

相关标签:
5条回答
  • 2021-02-05 06:40

    If you have multiple environments (staging / production / etc) you need this command:

    heroku run -a app-name console
    

    If you only have a single environment and never setup staging or other environments you can just run:

    heroku run console
    

    https://github.com/nemrow/rails_app_cheatsheet/blob/master/heroku.rdoc

    0 讨论(0)
  • 2021-02-05 06:40

    I was with the same problem and I decided to do this and it worked

    $ heroku run bash
    $ cd bin
    ~/bin $ ruby rails console
    
    0 讨论(0)
  • 2021-02-05 06:48

    For some reason you need to explicitly define the console process in the Procfile:

    # Procfile
    
    web: script/rails server -p $PORT
    console: script/rails console
    

    This blog post has more details: http://platypus.belighted.com/blog/2013/01/21/ruby-2-rails-4-heroku/

    0 讨论(0)
  • 2021-02-05 07:03

    For Cedar Stack and later:

    heroku run rails console --app <app name>
    

    Previous stacks could use this command:

    heroku run console --app <app name>
    
    0 讨论(0)
  • 2021-02-05 07:03

    You should just use heroku run console as others have answered.

    Heroku only runs in one environment at a time, which is configured by the RAILS_ENV and RACK_ENV environments variables.

    When you connect, the console will use the correct environment automatically.

    0 讨论(0)
提交回复
热议问题