为什么我得到无法找到任何来源的multi_json-1.3.1?

Sou*_*amy 9 deployment ruby-on-rails heroku bundler ruby-on-rails-3

我有一个简单的Rails应用程序,我想部署到Heroku.当我运行以下命令

git push heroku master
Run Code Online (Sandbox Code Playgroud)

显示以下错误消息.

 Could not find multi_json-1.3.1 in any of the sources
 !
 ! Failed to install gems via Bundler.
 !
 ! Heroku push rejected, failed to compile Ruby/rails app
Run Code Online (Sandbox Code Playgroud)

这是我的Gemfile

 gem 'rails', '3.2.3'
 gem 'pg'
 group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'therubyracer', :platform => :ruby
  gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
Run Code Online (Sandbox Code Playgroud)

小智 25

删除Gemfile.lock文件,然后运行bundle install.这适合我!

  • 在任何规模的项目上你绝对不应该这样做.删除`Gemfile.lock`相当于`bundle update` - 即一次更新Gemfile中的每个gem(没有固定版本).有了足够大的Gemfile,你可以保证搞定整个项目.而是运行`bundle update multi_json`来获取该gem的最新版本. (32认同)