2016-11-23 82 views
1

我正在为macOS Sierra上的Rails 5应用程序工作,一切进展顺利,直到我准备好生产Digital Ocean VPS。我跟着其中一个最着名的Deploy Rails app tutorial使用Capistrano,我经过一些错误终于实现了我的应用程序生产运行。如何恢复我的Rails 5 binstubs?

现在在我的当地环境当我运行rails serverrails 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, nilconfig/deploy.rb生成binstubs

一些文章,我发现:

  1. https://github.com/capistrano/rails/issues/171
  2. https://github.com/capistrano/capistrano/issues/1675
  3. Rails 5 console not working when deploying with Capistrano
  4. https://github.com/capistrano/bundler/issues/45

我真的很感激任何类型的帮助,你能提供给我。 在此先感谢。

回答

0

我知道这有点晚,但我发现我可以运行$ rails app:update,它会恢复/覆盖我的binstubs ...并覆盖所有其他配置文件。所以要小心这个。