Search code examples
ruby-on-railsbundlerubuntu-16.04rbenv

rails c wont work in app directory


Im trying to reach the production env console. I think rbenv is messing with me.

When i run rails console production i get the old:

Usage:
  rails new APP_PATH [options]

So i figure, it doesn't recognize my dir as an rails app because of the versions so I run. So the rails -v tells me:

deploy@webb-labb2:~/prognoser/current$ rails -v
Rails 5.1.0

Which is the wrong version of the app. And the bundle exec rails -v command gives me:

deploy@webb-labb2:~/prognoser/current$ bundle exec rails -v
Rails 4.2.8

Which is the correct version. But the:

deploy@webb-labb2:~/prognoser/current$ bundle exec rails console production

Still gives me the old:

Usage:
  rails new APP_PATH [options]

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

Solution

  • I ran

    $ bundle exec rake rails:update:bin 
    

    that did the trick. And I had to add a boot file to the shared/config directory.