【问题标题】:Bundle fails, undefined method `ruby' when deploying to heroku捆绑失败,部署到heroku时未定义方法“ruby”
【发布时间】:2013-05-01 18:28:11
【问题描述】:

我正在尝试将 Rack 应用程序部署到 heroku,但它在捆绑步骤中失败:

-----> Fetching custom git buildpack... done
-----> Ruby/Rack app detected
-----> Using RUBY_VERSION: ruby-1.9.3-p0
-----> Installing dependencies using Bundler version 1.1.rc.7
   Running: bundle install --without development:test --path vendor/bundle --binstubs bin/ --deployment
   /tmp/build_158s9o0ec0gdk/Gemfile:2:in `evaluate': undefined method `ruby' for #<Bundler::Dsl:0x00000001c7c418> (NoMethodError)
 (...)
   /app/bin/bundle:23:in `load'
   /app/bin/bundle:23:in `<main>'
   There was an error in your Gemfile, and Bundler cannot continue.
!
!     Failed to install gems via Bundler.
!
!     Heroku push rejected, failed to compile Ruby/rack app

失败是undefined method 'ruby' for #&lt;Bundler::Dsl:0x00000001c7c418&gt; (NoMethodError)

这来自我的 Gemfile

source 'https://rubygems.org'
ruby '2.0.0'

我认为这是因为该方法直到 1.2 版才添加到 Bundler 中,而 heroku 似乎使用的是 1.1.rc.7 版。

我不知道如何升级捆绑器的 heroku 版本。我已经在 Cedar 堆栈上。

【问题讨论】:

  • 日志显示Fetching custom git buildpack - 看起来您正在使用自定义构建包,这可能解释了为什么使用旧版本的 Bundler。 heroku config:get BUILDPACK_URL 有什么显示吗?
  • 你是对的。将其发布为答案,我将其标记为正确。

标签: heroku bundler


【解决方案1】:

日志显示Fetching custom git buildpack - 看起来您正在使用自定义构建包,这可能解释了为什么使用旧版本的 Bundler。

heroku config:get BUILDPACK_URL

显示什么?您可能只需要停止使用自定义 buildpack,试试

heroku config:unset BUILDPACK_URL

清除配置变量并恢复到正常的构建包。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-06-24
    • 1970-01-01
    • 2020-03-21
    • 2014-11-07
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多