简体   繁体   English

在Rails应用程序的gemfile中将Bundler与:path选项一起使用

[英]Using Bundler with :path option in gemfile in Rails app

I am working on a rails app which uses a gem also in development. 我正在开发也在开发中使用gem的Rails应用程序。 In my rails app, I have 在我的Rails应用中

gem 'somegem', :path => '~/r/somegem'

However, when I make changes to the code in somegem it does not update in my rails app. 但是,当我在somegem中更改代码时,它不会在我的rails应用程序中更新。 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. 重新启动Rails应用程序也无济于事。

Any suggestions on developing rails app with bundler and the :path option? 关于使用bundler和:path选项开发Rails应用程序的任何建议?

如捆绑程序网页所示,使用:path时,请不要忘记在代码顶部添加所需的需求。

require 'bundler/setup'

Run this command: 运行以下命令:

bundle install

This command evaluates your Gemfile and installs all missing dependencies. 此命令评估您的Gemfile并安装所有缺少的依赖项。 It will re-package your gem from that location and make it available via bundle exec next time you use it. 它将从该位置重新包装您的宝石,并在下次使用它时通过bundle exec使它可用。

Also, be sure to start the server with: 另外,请确保使用以下命令启动服务器:

bundle exec rails s

to be sure you're using your bundle's gems. 确保您使用的是捆绑包中的宝石。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM