gpt4 book ai didi

ruby-on-rails - !无法通过 Bundler Heroku Rails 安装 gems

转载 作者:行者123 更新时间:2023-12-04 07:31:08 26 4
gpt4 key购买 nike

我是 RoR 的新手,正在尝试在 heroku 上部署我的应用程序。我收到了您在标题中看到的错误。
Gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.7.0'
gem 'mail_form'
gem 'figaro'
gem 'rails', '~> 6.1.0'
# gem 'sqlite3', '~> 1.4'
gem 'puma', '~> 5.0'
gem 'sass-rails', '>= 6'
gem 'webpacker', '~> 5.0'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.7'
gem 'bootsnap', '>= 1.4.4', require: false
gem 'devise', '~> 4.7', '>= 4.7.3'
gem 'pg'

group :development, :test do
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
gem 'web-console', '>= 4.1.0'
gem 'rack-mini-profiler', '~> 2.0'
gem 'listen', '~> 3.3'
gem 'spring'
end

group :test do
gem 'capybara', '>= 3.26'
gem 'selenium-webdriver'
gem 'webdrivers'
end

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
堆栈
Enumerating objects: 424, done.
Counting objects: 100% (424/424), done.
Delta compression using up to 8 threads
Compressing objects: 100% (391/391), done.
Writing objects: 100% (424/424), 265.61 KiB | 6.18 MiB/s, done.
Total 424 (delta 193), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-18 stack
remote: -----> Determining which buildpack to use for this app
remote: ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below will be used.
remote: Detected buildpacks: Ruby,Node.js
remote: See https://devcenter.heroku.com/articles/buildpacks#buildpack-detect-order
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.2.16
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.7.0
remote: -----> Installing dependencies using bundler 2.2.16
remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote: Unable to find a spec satisfying nokogiri (>= 1.8.5) in the set. Perhaps the
remote: lockfile is corrupted? Found nokogiri (1.11.7-x86_64-darwin), nokogiri
remote: (1.11.7-x86_64-darwin), nokogiri (1.11.7-x86_64-darwin), nokogiri
remote: (1.11.7-x86_64-darwin), nokogiri (1.11.7-x86_64-darwin) that did not match the
remote: current platform.
remote: Bundler Output: Unable to find a spec satisfying nokogiri (>= 1.8.5) in the set. Perhaps the
remote: lockfile is corrupted? Found nokogiri (1.11.7-x86_64-darwin), nokogiri
remote: (1.11.7-x86_64-darwin), nokogiri (1.11.7-x86_64-darwin), nokogiri
remote: (1.11.7-x86_64-darwin), nokogiri (1.11.7-x86_64-darwin) that did not match the
remote: current platform.
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:
我已经解决了这里以前的所有问题并尝试了所有解决方案。
我已经尝试删除 gemfile.lock 并再次运行 bundle install 来重置它。我已经完成了各种 git add、提交和推送。我有点不知所措。任何建议将不胜感激。

最佳答案

nokogiri (1.11.7-x86_64-darwin)Darwin/MacOS 的原生 gem ,但 Heroku 运行 Linux以便它unable to find .
解决方案是avoid-using-a-precompiled-native-gem ,就您而言,bundler版本 2.2.+,那么你需要运行 bundle config set force_ruby_platform true你应该重新检查一下 Gemfile.lock不包含 nokogiri (1.11.7-x86_64-darwin) ,它应该包含 nokogiri (~> ...)

关于ruby-on-rails - !无法通过 Bundler Heroku Rails 安装 gems,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67925072/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com