【问题标题】:Push Rails app with gem 'eventmachine' on Heroku在 Heroku 上使用 gem 'eventmachine' 推送 Rails 应用程序
【发布时间】:2011-11-23 00:30:08
【问题描述】:

Heroku 正在尝试安装 gem 'eventmachine',即使它位于 :development 组中。如何解决?

# Gemfile
gem 'rails', '3.1.1'

...

group :development do
    gem 'eventmachine', '1.0.0.beta.4.1'
    gem 'guard-livereload'
end

错误信息

Could not find gem 'eventmachine (= 1.0.0.beta.4.1, runtime)' in any of the gem sources listed in your Gemfile.

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 heroku eventmachine


    【解决方案1】:

    通常 Heroku 不应该尝试安装 :development:test 组中的任何内容。但是,您可以通过设置明确排除这些组:

    heroku config:add BUNDLE_WITHOUT="development:test"
    

    【讨论】:

    • 嗯,这就是他们正在记录的内容:blog.heroku.com/archives/2011/2/15/…
    • 为您的 Heroku 应用配置的 RACK_ENV 是什么?
    • 你的意思是? $ heroku config -> RACK_ENV=production
    【解决方案2】:

    我遇到了同样的问题。运行bundle update 后,您是否将更改提交到 git?我忘了这样做,所以当我运行git push heroku master 时,它仍在使用我的旧Gemfile.lock。一旦我签入,部署到 heroku 就没有问题了。

    【讨论】:

    • 但是,heroku 不使用 Gemfile.lock(至少对我而言)Windows Gemfile.lock detected, ignoring it.
    猜你喜欢
    • 1970-01-01
    • 2010-12-30
    • 2015-04-23
    • 2015-01-01
    • 2018-12-22
    • 1970-01-01
    • 2014-11-01
    • 2016-05-12
    • 1970-01-01
    相关资源
    最近更新 更多