【问题标题】:Rails - Error pushing to Heroku - not seeing Gemfile.lockRails - 推送到 Heroku 时出错 - 没有看到 Gemfile.lock
【发布时间】:2011-10-28 11:00:12
【问题描述】:

我现在大部分时间都收到这个错误,我的大脑太煎熬,无法继续尝试确定问题所在:

这似乎是说我在版本控制中没有 Gemfile.lock,但是,这是我目前拥有的 Gemfile.lock - 从 github 上看到:

GEM
  remote: http://rubygems.org/
  specs:
    actionmailer (3.1.1)
      actionpack (= 3.1.1)
      mail (~> 2.3.0)
    actionpack (3.1.1)
      activemodel (= 3.1.1)
      activesupport (= 3.1.1)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      i18n (~> 0.6)
      rack (~> 1.3.2)
      rack-cache (~> 1.1)
      rack-mount (~> 0.8.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.0.2)
    activeadmin (0.3.2)
      devise (>= 1.1.2)
      fastercsv
      formtastic (< 2.0.0)
      inherited_resources (< 1.3.0)
      kaminari (>= 0.12.4)
      meta_search (>= 0.9.2)
      rails (>= 3.0.0)
      sass (>= 3.1.0)
    activemodel (3.1.1)
      activesupport (= 3.1.1)
      builder (~> 3.0.0)
      i18n (~> 0.6)
    activerecord (3.1.1)
      activemodel (= 3.1.1)
      activesupport (= 3.1.1)
      arel (~> 2.2.1)
      tzinfo (~> 0.3.29)
    activeresource (3.1.1)
      activemodel (= 3.1.1)
      activesupport (= 3.1.1)
    activesupport (3.1.1)
      multi_json (~> 1.0)
    addressable (2.2.6)
    ansi (1.3.0)
    arel (2.2.1)
    bcrypt-ruby (3.0.1-x86-mingw32)
    builder (3.0.0)
    coffee-rails (3.1.1)
      coffee-script (>= 2.2.0)
      railties (~> 3.1.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.1.2)
    devise (1.4.9)
      bcrypt-ruby (~> 3.0)
      orm_adapter (~> 0.0.3)
      warden (~> 1.0.3)
    erubis (2.7.0)
    execjs (1.2.9)
      multi_json (~> 1.0)
    fastercsv (1.5.4)
    formtastic (1.2.4)
      actionpack (>= 2.3.7)
      activesupport (>= 2.3.7)
      i18n (~> 0.4)
    has_scope (0.5.1)
    heroku (2.11.0)
      launchy (>= 0.3.2)
      rest-client (~> 1.6.1)
      rubyzip
      term-ansicolor (~> 1.0.5)
    hike (1.2.1)
    i18n (0.6.0)
    inherited_resources (1.2.2)
      has_scope (~> 0.5.0)
      responders (~> 0.6.0)
    jquery-rails (1.0.16)
      railties (~> 3.0)
      thor (~> 0.14)
    json (1.6.1)
    kaminari (0.12.4)
      rails (>= 3.0.0)
    launchy (2.0.5)
      addressable (~> 2.2.6)
    mail (2.3.0)
      i18n (>= 0.4.0)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    meta_search (1.1.1)
      actionpack (~> 3.1.0)
      activerecord (~> 3.1.0)
      activesupport (~> 3.1.0)
      polyamorous (~> 0.5.0)
    mime-types (1.17.2)
    multi_json (1.0.3)
    orm_adapter (0.0.5)
    pg (0.11.0-x86-mingw32)
    polyamorous (0.5.0)
      activerecord (~> 3.0)
    polyglot (0.3.2)
    rack (1.3.5)
    rack-cache (1.1)
      rack (>= 0.4)
    rack-mount (0.8.3)
      rack (>= 1.0.0)
    rack-ssl (1.3.2)
      rack
    rack-test (0.6.1)
      rack (>= 1.0)
    rails (3.1.1)
      actionmailer (= 3.1.1)
      actionpack (= 3.1.1)
      activerecord (= 3.1.1)
      activeresource (= 3.1.1)
      activesupport (= 3.1.1)
      bundler (~> 1.0)
      railties (= 3.1.1)
    railties (3.1.1)
      actionpack (= 3.1.1)
      activesupport (= 3.1.1)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (~> 0.14.6)
    rake (0.9.2.2)
    rdoc (3.11)
      json (~> 1.4)
    responders (0.6.4)
    rest-client (1.6.7)
      mime-types (>= 1.16)
    rubyzip (0.9.4)
    sass (3.1.10)
    sass-rails (3.1.4)
      actionpack (~> 3.1.0)
      railties (~> 3.1.0)
      sass (>= 3.1.4)
      sprockets (~> 2.0.0)
      tilt (~> 1.3.2)
    sprockets (2.0.3)
      hike (~> 1.2)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sqlite3 (1.3.4-x86-mingw32)
    term-ansicolor (1.0.7)
    thor (0.14.6)
    tilt (1.3.3)
    treetop (1.4.10)
      polyglot
      polyglot (>= 0.3.1)
    turn (0.8.3)
      ansi
    tzinfo (0.3.30)
    uglifier (1.0.4)
      execjs (>= 0.3.0)
      multi_json (>= 1.0.2)
    warden (1.0.6)
      rack (>= 1.0)

PLATFORMS
  x86-mingw32

DEPENDENCIES
  activeadmin
  coffee-rails (~> 3.1.1)
  devise (~> 1.4.7)
  heroku
  jquery-rails
  pg
  rails (= 3.1.1)
  sass-rails (~> 3.1.4)
  sqlite3
  turn
  uglifier (>= 1.0.3)

我尝试过的步骤:

  • 删除 Gemfile.lock 并运行包更新以生成新文件

  • 推送前特别说明“git add Gemfile.lock”
    github

  • 我从资产中取出了 sass-rails gem,以防在需要时
    生产

  • 删除 .gitignore 的内容以确保没有任何内容 依赖被忽略

如果有帮助,这是一个 Rails 3.1.1 应用程序,我也在使用 ActiveAdmin。

非常感谢任何建议!

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-3 ruby-on-rails-3.1


    【解决方案1】:

    Heroku 不允许您使用在 Windows 上生成的 Gemfile.lock。最好的办法是在 *nix 系统上创建 .lock 文件。使用在Virtual Box 上运行的 Mac、Linux 等。

    或者,您可以尝试删除这些行

    PLATFORMS
      x86-mingw32
    

    虽然这可能会导致问题。

    【讨论】:

    • 嗯...这很奇怪。我目前有几个在 Heroku 上运行的应用程序,它们都是在 Windows 中制作的,它们都有一个 Gemfile.lock,其中包含各种出现的 x86-mingw32。我对这些没有任何问题。唯一不同的是,这个运行的是 Rails 3.1.1,而其他运行的是 Rails 3.0.10。这只是较新版本的问题吗?
    【解决方案2】:

    去掉所有在 gem 规范和行中出现的 -x86-mingw32

    PLATFORMS
      x86-mingw32
    

    正如亚历克斯所说。

    我理解为什么 Heroku 现在需要 Gemfile.lock,但总的来说我不同意这种做法。

    【讨论】:

    • 您好向导,您知道这是不是最近的更改吗?我已经在 Heroku 上运行了一些使用 3.0.10 的应用程序,它们都引用了 x86-mingw32。
    • Heroku 很久以前就宣布了他们这样做的意图。我仍然从 Bamboo-1.8.7 上的应用程序中收到警告,但是在尝试部署到 Cedar 堆栈时遇到了与您相同的错误。进行我建议的更改为我解决了问题。
    • 好的,谢谢。我遇到了其他一些问题,但这让我摆脱了 Bundler 问题。答案都很相似,但由于额外的沟通,我对两者都投赞成票并将其标记为答案。谢谢你们!
    猜你喜欢
    • 2011-12-13
    • 1970-01-01
    • 2018-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-09-18
    • 2015-01-01
    相关资源
    最近更新 更多