I'm working in a Rails 5 app on macOS Sierra and everything was going well until I was ready for production to a Digital Ocean VPS. I followed one of the most famous Deploy Rails app tutorial using Capistrano, I after some bugs finally my app came to live running on production.
Now in my local environment when I run rails server
or rails console
I got this warning and I don't know how to fix it or whats going wrong with that.
Looks like your app's ./bin/rails is a stub that was generated by Bundler.
In Rails 5, 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
rails app:update:bin # Use the new Rails 5 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
=> Booting Puma
=> Rails 5.0.0.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.6.0 (ruby 2.3.1-p112), codename: Sleepy Sunday Serenity
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
I have been searching whats this bug and how to fix it but I have no luck! And for reference it seems to be something with Capistrano
but I have done what they said is the solution and it does not work or maybe I have not implement it in the right way:
The solution would be:
1.- remove
bin
from thelinked_dirs
(which was not my case)2.- add
set :bundle_binstubs, nil
to yourconfig/deploy.rb
to generate the binstubs
Some articles I found:
- https://github.com/capistrano/rails/issues/171
- https://github.com/capistrano/capistrano/issues/1675
- Rails 5 console not working when deploying with Capistrano
- https://github.com/capistrano/bundler/issues/45
I really appreciate any type of help you could provide me. Thanks in advance.