首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在部署中使用其他gem

在部署中使用其他gem
EN

Stack Overflow用户
提问于 2021-08-27 08:35:00
回答 2查看 71关注 0票数 0

如果Gemfile.lock存在,有谁知道如何添加ruby gem吗?

我正在使用一个来自apt包的应用程序,但我想添加我的自定义gem。

在Gemfile中,它写道:

代码语言:javascript
复制
# Want to extend Zammad with additional gems?
# ZAMMAD USERS: Specify them in Gemfile.local
# (That way, you can customize the Gemfile
# without having your changes overwritten during upgrades.)

但是,如果我用我的Gem创建Gemfile.local,应用程序就无法启动。

代码语言:javascript
复制
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.

If this is a development machine, remove the / opt / zammad / Gemfile freeze
by running bundle install --no-deployment.

The list of sources changed
The dependencies in your gem file changed

You have added to the Gemfile:

mySpecialGem

我曾经可以使用bundle install --no-deployment来做这件事,但是当我这样做时,我总是得到相同的消息

EN

回答 2

Stack Overflow用户

发布于 2021-08-28 12:32:55

您是否将gem安装为:

代码语言:javascript
复制
gem "gem_name", path: "/Users/Matthies/gem_location"

你能发布你的Gemfile是什么样子的吗?

票数 0
EN

Stack Overflow用户

发布于 2021-08-29 13:53:08

原始包中的gemfile是https://github.com/zammad/zammad/blob/stable/Gemfile

在我的Gemfile.local中是这样的:

代码语言:javascript
复制
gem 'gem_name', git: 'https://github.com/myname/mygem'
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68950389

复制
相关文章

相似问题

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