在 Rails 应用程序的 gemfile 中使用 Bundler 和 :path 选项
我正在开发一个 Rails 应用程序,它也在开发中使用 gem。在我的 Rails 应用程序中,我有
gem 'somegem', :path => '~/r/somegem'
但是,当我更改 somegem 中的代码时,它不会在我的 Rails 应用程序中更新。我不确定在进行更改后应该使用哪些捆绑器命令,或者是否需要这样做。重新启动 Rails 应用程序也没有帮助。
关于使用捆绑器和 :path 选项开发 Rails 应用程序有什么建议吗?
I am working on a rails app which uses a gem also in development. In my rails app, I have
gem 'somegem', :path => '~/r/somegem'
However, when I make changes to the code in somegem it does not update in my rails app. I'm not sure which bundler commands I should be using after making changes, or if I need to at all. Restarting the rails app doesn't help either.
Any suggestions on developing rails app with bundler and the :path option?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
运行此命令:
此命令评估您的 Gemfile 并安装所有缺少的依赖项。它将从该位置重新打包您的 gem,并在您下次使用它时通过
bundle exec
使其可用。另外,请务必使用以下命令启动服务器:
以确保您正在使用捆绑包的 gems。
Run this command:
This command evaluates your Gemfile and installs all missing dependencies. It will re-package your gem from that location and make it available via
bundle exec
next time you use it.Also, be sure to start the server with:
to be sure you're using your bundle's gems.
如捆绑程序网页中所示,使用 :path 时,不要忘记在代码顶部添加所需的 require。
As indicated in the bundler webpage, don't forget to add the needed require at the top of your code when using :path.