【发布时间】:2016-11-23 04:37:16
【问题描述】:
我在 macOS Sierra 上使用 Rails 5 应用程序,一切都进行得很顺利,直到我准备好在 Digital Ocean VPS 上进行生产。我使用 Capistrano 关注了最著名的Deploy Rails app tutorial 之一,经过一些错误之后,我的应用终于在生产环境中运行了。
现在在我的 本地环境中,当我运行 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
我一直在寻找这个错误是什么以及如何修复它,但我没有运气!作为参考,它似乎与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
非常感谢您能为我提供的任何帮助。 提前致谢。
【问题讨论】:
标签: bundle ruby-on-rails-5 capistrano3 bin rvm-capistrano