首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何恢复Rails 5的二进制存根?

如何恢复Rails 5的二进制存根?
EN

Stack Overflow用户
提问于 2016-11-23 04:37:16
回答 1查看 3.7K关注 0票数 3

我是在一个Rails 5应用程序的macOS塞拉利昂和一切都进行得很好,直到我准备生产的数字海洋VPS。我使用了一个最著名的部署Rails应用教程,使用了Capistrano,在经历了一些bug之后,我的应用程序终于开始在生产中运行。

现在,在我的本地环境中,当我运行rails serverrails console 时,我得到了警告,我不知道如何修复它,也不知道它出了什么问题。

代码语言:javascript
复制
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.-从bin中删除linked_dirs (这不是我的情况) 2.-将set :bundle_binstubs, nil添加到config/deploy.rb以生成binstub

我发现了一些文章:

  1. https://github.com/capistrano/rails/issues/171
  2. https://github.com/capistrano/capistrano/issues/1675
  3. Rails 5控制台在使用Capistrano部署时无法工作
  4. https://github.com/capistrano/bundler/issues/45

我真的很感激你能为我提供的任何帮助。提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2017-07-29 15:07:08

我知道这有点晚了,但我发现我可以运行$ rails app:update,它会恢复/覆盖我的本存根.随着覆盖所有其他配置文件,您开始使用。所以小心点。

有关此任务的更多信息,请参见升级Rails指南。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/40756126

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档