【问题标题】:Use additional gem in deployment在部署中使用额外的 gem
【发布时间】:2021-08-27 08:34:59
【问题描述】:

如果 Gemfile.lock 存在,有人知道如何添加 ruby​​ 宝石吗?

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

在 Gemfile 中它说:

# 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,则应用程序无法启动。

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 来做到这一点,但是当我这样做时,我总是得到相同的消息

【问题讨论】:

    标签: ruby-on-rails ruby rubygems


    【解决方案1】:

    您是否将 gem 安装为:

    gem "gem_name", path: "/Users/Matthies/gem_location"
    

    您能发布一下您的 Gemfile 的样子吗?

    【讨论】:

      【解决方案2】:

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

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

      gem 'gem_name', git: 'https://github.com/myname/mygem'
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2010-10-19
        • 1970-01-01
        • 2015-02-06
        • 1970-01-01
        • 2012-08-06
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多