在Heroku上找不到gem bundler(> = 0)(Gem :: GemNotFoundException)

4
当我运行 heroku run bundle install 时,它给了我一个错误。
/usr/lib/ruby/1.9.1/rubygems.rb:308:in `bin_path': can't find gem bundler (>= 0) (Gem::GemNotFoundException)
from /app/bin/bundle:3:in `<main>'

当我运行heroku run rails console时,会出现错误。

/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- bundler (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /app/bin/spring:8:in `<top (required)>'
from /app/bin/rails:3:in `load'
from /app/bin/rails:3:in `<main>'

我的工作是什么?

我在其中添加了Node.js构建包。


Heroku已经预先安装了Ruby和Bundler。当您将存储库推送到Heroku时,它会检测到您有“Gemfile”,并自动运行bundle install。您将存储库推送到Heroku时会发生什么?您能在这里添加输出吗? - Uzbekjon
我添加了Node.js构建包。 - haseeb ahmad
当我运行heroku run rake db:migrate时,也遇到了相同的错误。 - haseeb ahmad
你是在开发Rails应用还是Node? - Uzbekjon
1个回答

2

我最近也有类似的经历

/usr/lib/ruby/1.9.1/rubygems.rb:308:in `bin_path':找不到 gem bundler (>= 0) (Gem::GemNotFoundException)

但是通过使用 NodeRuby 的构建包同时解决了这个问题。

检查您当前的构建包。

heroku buildpacks

Node之后添加Ruby构建包。
heroku buildpacks:add --index 2 https://github.com/heroku/heroku-buildpack-ruby

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接