intercity / chef-repo

Set up your server to host Ruby on Rails apps. - Follow us on Twitter: @intercityup
MIT License
417 stars 84 forks source link

Cannot run rails console production on server. #163

Closed cvandermeer closed 9 years ago

cvandermeer commented 9 years ago

Cannot run rails console production on server.

root@myserver:/u/apps/stageapp_production/current# bundle exec rails console production bin/rails:3:in require_relative': cannot load such file -- /u/apps/stageapp_production/shared/config/boot (LoadError) from bin/rails:3:in

'

jvanbaarsen commented 9 years ago

@cvandermeer Hi, you can run the console by this command: RAILS_ENV=production bin/rails console.

cvandermeer commented 9 years ago

I get the same error. Issue with ruby or rails perhaps? bin/rails:3:in require_relative': cannot load such file -- /u/apps/stageapp_production/shared/config/boot (LoadError) from bin/rails:3:in

'

michiels commented 9 years ago

@cvandermeer Did it work?

cvandermeer commented 9 years ago

No, instead of using rails console production, i used a seed to create a new user.

The command above gives me this error message: Looks like your app's ./bin/rails is a stub that was generated by Bundler.

In Rails 4, your app's bin/ directory contains executables that are versioned like any other source code, rather than stubs that are generated on demand.

Here's how to upgrade:

bundle config --delete bin # Turn off Bundler's stub generator rake rails:update:bin # Use the new Rails 4 executables git add bin # Add bin/ to source control

You may need to remove bin/ from your .gitignore as well.

When you install a gem whose executable you want to use in your app, generate it and add it to source control:

bundle binstubs some-gem-name git add bin/new-executable

/opt/rbenv/versions/2.1.2/lib/ruby/2.1.0/irb/completion.rb:9:in require': cannot load such file -- readline (LoadError) from /opt/rbenv/versions/2.1.2/lib/ruby/2.1.0/irb/completion.rb:9:in<top (required)>'

richhollis commented 9 years ago

Are you using Capistrano 3 by any chance? I had the same error and this is fixed by this: http://stackoverflow.com/questions/26151443/capistrano-3-deployment-for-rails-4-binstubs-conflict

cvandermeer commented 9 years ago

I am actually, thanks i will look into this.

cvandermeer commented 9 years ago

It worked!

richhollis commented 9 years ago

Great! I suspected Capistrano when I noticed 'shared' in the relative path error. Glad you got it fixed.

dfang commented 7 years ago

@richhollis +1 for stackoverflow link, thanks

Schwad commented 7 years ago

@cvandermeer I came here from a completely different issue with the same error in 2017 and wanted to share that your comment on 1/20/17 is what resolved it for me. Thanks!