我正在为macOS Sierra上的Rails 5应用程序工作,一切进展顺利,直到我准备好生产Digital Ocean VPS。我跟着其中一个最着名的Deploy Rails app tutorial使用Capistrano,我经过一些错误终于实现了我的应用程序生产运行。如何恢复我的Rails 5 binstubs?
或现在在我的当地环境当我运行rails server
rails console
我得到这个警告,我不知道如何解决它或什么与怎么了?。
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
我一直在寻找这个bug以及如何解决它,但我没有运气!而对于参考它似乎是一些与Capistrano
,但我已经做了,他们说的是解决方案,它不工作,也许我还没有实现它的正确方法:
篇的解决办法是:
1.-从
linked_dirs
删除bin
(这是不是我的情况)2:添加
set :bundle_binstubs, nil
您config/deploy.rb
生成binstubs
一些文章,我发现:
- 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
我真的很感激任何类型的帮助,你能提供给我。 在此先感谢。