加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – 为开发/测试和生产指定两次相同的gem,但路径不

发布时间:2020-12-17 03:17:28 所属栏目:百科 来源:网络整理
导读:有时你制作一个特定于项目的宝石.这有助于抽象并从主Rails应用程序中拉出一些“责任”,并进入更加模块化的地方. 宝石将位于您的应用程序上: gem 'example_gem',path: './example_gem' 你捆绑,一切都好.现在,你git初始化gem并将它存储在github上的自己的repo
有时你制作一个特定于项目的宝石.这有助于抽象并从主Rails应用程序中拉出一些“责任”,并进入更加模块化的地方.

宝石将位于您的应用程序上:

gem 'example_gem',path: './example_gem'

你捆绑,一切都好.现在,你git初始化gem并将它存储在github上的自己的repo中.您尝试这样做是为了保持开发人员友好:

group :development,:test do
  gem 'example_gem',path: './example_gem'
end

group :production do
  gem 'example_gem',github: 'company/example_gem'
end

为了增加工作流程,你可以在后面拍拍自己,但是在运行bundle后你得到:

Your Gemfile lists the gem example_gem (>= 0) more than once.
You should probably keep only one of them.
While it's not a problem now,it could cause errors if you change the version of just one of them later.
You cannot specify the same gem twice coming from different sources.
You specified that example_gem (>= 0) should come from source at ./example_gem and git://github.com/company/example_gem.git

这里的工作流程是能够在开发中编辑gem,当你完成后,提交这些更改并将它们推送到Github.但是,在开发时,您不希望在主应用程序上执行git commit,git push和bundle更新,只是为了看到一个小的更改.

有谁知道解决这个问题的更好方法?

解决方法


502 Bad Gateway

502 Bad Gateway


nginx/1.12.2

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读