如何克隆宝石,修复它,将其添加到repo,捆绑包中并用导轨部署

发布于 2025-02-01 14:27:03 字数 479 浏览 2 评论 0原文

我有一个Rails 5应用程序,它使用了一颗宝石,它不再在生产中起作用。我修复了它,试图通过遵循此食谱来将其添加到我本地的gemfile中:

​因此,我尝试在供应商/GEMS目录中将其添加到仓库中。一切都很好,但是当我尝试部署时,我会得到:

You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

我遵循清理和排斥的食谱,同样的错误。为了使事情复杂化,我们使用RVM,不确定这是一个问题,而只是添加其他信息。

因此,通常,您如何修复别人的宝石上的缺陷(存储库是关闭的您的存储库并确保Capistrano和Bundler将在生产中使用您的本地资源?

谢谢, 凯文

I have a Rails 5 app, it uses a gem, it no longer works in production. I fixed it, tried to add it to my local Gemfile by following this recipe:

https://gist.github.com/zulhfreelancer/1d30bf77e9b26773a6b45c99fc0a4b0b

(but this recipe doesn't offer how to add it to your repo). So, I tried git add -all'ing it to the repo in my vendor/gems directory. All works great, but when I try to deploy, I get:

You are trying to install in deployment mode after changing
your Gemfile. Run `bundle install` elsewhere and add the
updated Gemfile.lock to version control.

I followed the recipes for clearing and rebundling, same error. To complicate things, we use rvm, not sure that's an issue but just adding additional info.

So in general, how do you fix a defect on someone else's gem (the repo is closed so I can't submit a pull request, although I did leave an issue), and use your locally modified gem in your app by adding it to your repo and making sure capistrano and bundler will use your local source in production?

Thanks,
Kevin

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

ペ泪落弦音 2025-02-08 14:27:03

步骤

  1. 在您的帐户下,在github上的项目

  2. 进行了您想要的更改

  3. 使用gem'gem_name',git:'your_forked_project',分支:'the_branch_you_working_on'

  4. run bundle bundle install

Steps

  1. Fork the project under your account on Github

  2. Make the changes you want

  3. Use gem 'gem_name', git: 'your_forked_project', branch: 'the_branch_you_working_on'

  4. Run bundle install

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文