ruby-on-rails - Heroku, bundler 因缺少依赖项而失败

标签 ruby-on-rails ruby heroku bundler

我最近在尝试在 Heroku 上部署 Rails 应用程序时遇到了麻烦。过去,我在 Heroku 上部署应用程序没有问题,但 Heroku 不再支持 ruby​​ 2.0.0。他们建议将 ruby "2.2.4" 添加到 Gemfile 中,这就是我所做的。我的 Gemfile 的开头如下:

source 'https://rubygems.org'
ruby "2.2.4"

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use pg as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
...

所以,我在我的计算机上运行了版本 1.7.8 的bundle install,没有任何问题。我什至可以在生产模式下运行我的应用程序。但是,当我尝试在 Heroku 上部署该应用程序时,我得到以下信息:

-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.2.4
-----> Installing dependencies using bundler 1.11.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       Fetching gem metadata from https://rubygems.org/...........
       Fetching version metadata from https://rubygems.org/...
       Fetching dependency metadata from https://rubygems.org/..
       Using rake 10.4.2
       Installing i18n 0.7.0
       Installing minitest 5.4.3
       Installing json 1.8.3 with native extensions
       Installing thread_safe 0.3.4
       Installing builder 3.2.2
       Installing erubis 2.7.0
       Your Gemfile.lock is corrupt. The following gem is missing from the DEPENDENCIES
       section: 'mini_portile2'
       Bundler Output: Fetching gem metadata from https://rubygems.org/...........
       Fetching version metadata from https://rubygems.org/...
       Fetching dependency metadata from https://rubygems.org/..
       Using rake 10.4.2
       Installing i18n 0.7.0
       Installing minitest 5.4.3
       Installing json 1.8.3 with native extensions
       Installing thread_safe 0.3.4
       Installing builder 3.2.2
       Installing erubis 2.7.0
       Your Gemfile.lock is corrupt. The following gem is missing from the DEPENDENCIES
       section: 'mini_portile2'
 !
 !     Failed to install gems via Bundler.
 !
 !     Push rejected, failed to compile Ruby app

非常感谢任何帮助。

最佳答案

我建议删除您的 Gemfile.lock,在本地再次运行 bundle install,将新的 Gemfile.lock 提交到您的 git 存储库,然后尝试您的 git push heroku master 再次。

关于ruby-on-rails - Heroku, bundler 因缺少依赖项而失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36962688/

相关文章:

ruby - ruby 中的浮点精度

ruby-on-rails - Rails slim form_for 标签

ruby-on-rails - Time.use_zone 未按预期工作

ruby-on-rails - 如何在不知道其属性的情况下枚举 ActiveRecord 对象

java - Heroku - Java Maven 项目 depoly - 完成 git Push heroku master 后出现应用程序错误

Heroku 应用程序的 API 子域,可能吗?

node.js - 部署到heroku时,在node_modules中使用修改后的库

ruby-on-rails - 回形针力 下载

ruby - Watir-webdriver:Firefox 未单击正确的链接,但 IE 和 Chrome 工作正常

c# - Ruby 中 C# 的 int.TryParse() 方法等同于什么?