我正在尝试更新我的RoR应用程序以在新的Heroku服务器上运行。我继续犯错误:
'Downloading nokogiri-1.10.3 revealed dependencies not in the API or the lockfile
remote: (mini_portile2 (~> 2.4.0)).
remote: Either installing with `--full-index` or running `bundle
update nokogiri` should
remote: fix the problem. '. mini_portile2和nokogiri都出现在Gemfile和Gemfile.Lock中。在旧服务器上使用旧版本很好。新的verion在家里使用rails服务器工作,没有显示依赖问题。我已经验证和检查了依赖关系,因为我知道如何和遵循Heroku的建议安装与‘-全索引’和运行‘包更新nokogiri’多次。我需要做些什么才能让它发挥作用?我正在使用最新的Cygwin和最新的Ruby和Rails版本,我相信正确的宝石。窗口7。
bundle install --full-index #无变化bundle update nokogiri #无变化gem install nokogiri #无变化gem install nokogiri --system-dependencies #无变化gem install nokogiri -- --use-system-libraries --with-xml2-config=/usr/include/libxml2 --with-xslt-config=/usr/include/libxslt # nochange每次安装宝石之后,我都会更新/安装包。
错误:
remote: Installing i18n 0.9.5
remote: Downloading nokogiri-1.10.3 revealed dependencies not in the API or the lockfile
remote: (mini_portile2 (~> 2.4.0)).
remote: Either installing with `--full-index` or running `bundle update nokogiri` should
remote: fix the problem.
remote:
remote: !
remote: ! Failed to install gems via Bundler.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to vast-sea-55538.
remote:
To https://git.heroku.com/vast-sea-55538.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/vast-sea-55538.git'创业板档案:
source 'https://rubygems.org'
ruby '2.6.3', :patchlevel => '62'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rake', '~>12.0'
gem 'rails', '4.2.8'
# rails_12factor is required by Heroku
gem 'rails_12factor', group: :production
# Use sqlite3 as the database for Active Record
# Use production for AWS Beanstalk
# gem 'sqlite3', '~> 1.3.10', group: :production
# Use development for Heroku
gem 'sqlite3', '~> 1.3.10', group: :development
# pg is required by Heroku
gem 'pg', '~>0.18.1', group: :production
# nokogiri dev dependencies
# gem 'concourse', '~> 0.24'
# gem 'hoe', '~> 3.17'
# gem 'hoe-bundler', '~> 1.2'
# gem 'hoe-debugging', '~> 2.0'
# gem 'hoe-gemspec', '~> 1.0'
# gem 'hoe-git', '~> 1.6'
# gem 'racc', '~> 1.4.14'
# gem 'rexical', '~> 1.0.5'
# gem 'simplecov', '~> 0.16'
# gem 'rake-compiler-dock', '~> 0.7.0'
# simplecov dependencies
# gem 'docile', '~> 1.1'
# gem 'simplecov-html', '~> 0.10.0'
# docile dependencies
# gem 'github-markup', '>= 0'
# gem 'redcarpet', '=> 0'
# gem 'yard', '=> 0'
# redcarpet dependencies
# gem 'test-unit', '~> 3.1.3'
# test-unit dependencies
# gem 'power_assert', '>= 0'
# gem 'kramdown', '>= 0'
# gem 'packnga', '>= 0'
# power_assert dependencies
# gem 'benchmark-ips', '>= 0'
# gem 'pry', '>= 0'
# pry dependencies
# gem 'coderay', '~> 1.1.0'
# gem 'method_source', '~> 0.9.0'
# kramdown dependencies
# gem 'rouge', '>= 0'
# gem 'stringex', '~> 1.5.1'
# stringex dependencies
# gem 'jeweler', '= 2.3.7'
# gem 'RedCloth', '= 4.2.9'
# gem 'travis-lint', '= 1.7.0'
# github-markup dependencies
# gem 'github-linguist', '>= 7.1.3'
# gem 'html-pipeline', '~> 1.0'
# gem 'nokogiri-diff', '>= 0.2.0'
# gem 'sanitize', '~> 2.1, >= 2.1.0'
# sanitize dependencies
# gem 'nokogumbo', '~> 2.0'
# Use SCSS for stylesheets
gem 'sassc'
gem 'sassc-rails'
# 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/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'json', '~> 2.1.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
# Use ActiveModel has_secure_password
gem 'rake-compiler', '~>1.0.3'
gem 'bcrypt', '~> 3.1.12'
# Use Unicorn as the app server
# gem 'unicorn'
gem 'mini_portile', '~> 0.6.2'
# mini_portile2 dependencies
# gem 'minitar', '~> 0.7'
# gem 'minitest-hooks', '~> 1.5.0'
# minitar dependencies
# gem 'hoe-doofus', '~> 1.0'
# gem 'hoe-gemspec2', '~>1.1'
# gem 'hoe-git', '~>1.6'
# gem 'hoe-rubygems', '~>1.0'
# gem 'hoe-travis', '~>1.2'
# gem 'minitest-autotest', '< 2, >= 1.0'
# minitest-autotest dependencies
# gem 'minitest-server', '~> 1.0'
# hoe-gemspec2 dependencies
# gem 'hoe-seattlerb', '>= 1.2'
# puma is required by AWS Beanstalk
# gem 'puma'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
gem 'rspec-rails', '~> 3.1'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
gem 'spring'
end
group :production do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'mini_portile2', '~> 2.4.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]发布于 2022-11-23 13:39:12
很可能你的Gemfile.lock是在Machine上创建的。Heroku在Linux上运行,nokogiri有额外的依赖项(mini_portile2)。
bundle lock --add-platform ruby给gemfile.lock添加了缺失的宝石。
在添加ruby + bundle install之后,我得到:
nokogiri (1.11.7)
⋮ 459│ mini_portile2 (~> 2.5.0)
⋮ 460│ racc (~> 1.4)
⋮ 461│ nokogiri (1.11.7-arm64-darwin)
⋮ 462│ racc (~> 1.4)
⋮ 463│ nokogiri (1.11.7-x86_64-linux)
458⋮ 464│ racc (~> 1.4)附带注意:实际上,它应该安装除了java https://github.com/sparklemotion/nokogiri/blob/v1.11.7/nokogiri.gemspec#L11之外的所有东西,但是它有一些问题。
https://stackoverflow.com/questions/55974143
复制相似问题