Rails Heroku 部署失败:无法找到 gems,无法通过 Bundler 安装 gems

问题描述 投票:0回答:1

所以我有一个 Rails 应用程序,我正在尝试将其推送到 Heroku。当我运行 git push heroku master 时,我得到:

$ git push heroku master
Enumerating objects: 1369, done.
Counting objects: 100% (1369/1369), done.
Delta compression using up to 12 threads
Compressing objects: 100% (906/906), done.
Writing objects: 100% (1369/1369), 35.15 MiB | 1.66 MiB/s, done.
Total 1369 (delta 755), reused 829 (delta 398), pack-reused 0 (from 0)
remote: Resolving deltas: 100% (755/755), done.
remote: Updated 169 paths from d8b5ada
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-22 stack
remote: -----> Using buildpack: heroku/ruby
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.5.6
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-3.2.2
remote: -----> Installing dependencies using bundler 2.5.6
remote:        Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4
remote:        Could not find rails-7.1.3.4, sprockets-rails-3.5.1, pg-1.5.6, puma-6.0.2,
remote:        importmap-rails-2.0.1, turbo-rails-2.0.5, stimulus-rails-1.3.3, jbuilder-2.12.0,
remote:        tzinfo-data-1.2024.1, bootsnap-1.18.3, sendgrid-ruby-6.7.0, devise-4.9.4,
remote:        letter_opener-1.10.0, activerecord-7.1.3.4, actiontext-7.1.3.4,
remote:        htmlbeautifier-1.4.3, base64-0.2.0, bigdecimal-3.1.8, mutex_m-0.2.0,
remote:        tailwindcss-rails-2.6.1, actioncable-7.1.3.4, actionmailbox-7.1.3.4,
remote:        actionmailer-7.1.3.4, actionpack-7.1.3.4, actionview-7.1.3.4, activejob-7.1.3.4,
remote:        activemodel-7.1.3.4, activestorage-7.1.3.4, activesupport-7.1.3.4,
remote:        railties-7.1.3.4, sprockets-4.2.1, nio4r-2.7.3, tzinfo-2.0.6, msgpack-1.7.2,
remote:        ruby_http_client-3.5.5, bcrypt-3.1.20, responders-3.1.1, launchy-3.0.1,
remote:        timeout-0.4.1, globalid-1.2.1, nokogiri-1.16.6, mini_magick-4.13.1,
remote:        ruby-vips-2.2.1, websocket-driver-0.7.6, zeitwerk-2.6.16, mail-2.8.1,
remote:        net-imap-0.4.14, net-smtp-0.5.0, rails-dom-testing-2.2.0, racc-1.8.0,
remote:        rack-3.1.6, rack-session-2.0.0, rack-test-2.1.0, rails-html-sanitizer-1.6.0,
remote:        builder-3.3.0, erubi-1.13.0, marcel-1.0.4, concurrent-ruby-1.3.3,
remote:        connection_pool-2.4.1, drb-2.2.1, i18n-1.14.5, minitest-5.24.1, irb-1.13.2,
remote:        rackup-2.1.0, rake-13.2.1, thor-1.3.1, addressable-2.8.7, childprocess-5.0.0,
remote:        mini_portile2-2.8.7, ffi-1.17.0, mini_mime-1.1.5, date-3.3.4,
remote:        net-protocol-0.2.2, loofah-2.22.0, rdoc-6.7.0, reline-0.5.9, webrick-1.8.1,
remote:        public_suffix-6.0.0, psych-5.1.2, io-console-0.7.2, stringio-3.1.1 in cached
remote:        gems or installed locally
remote:        Bundler Output: Could not find rails-7.1.3.4, sprockets-rails-3.5.1, pg-1.5.6, puma-6.0.2,
remote:        importmap-rails-2.0.1, turbo-rails-2.0.5, stimulus-rails-1.3.3, jbuilder-2.12.0,
remote:        tzinfo-data-1.2024.1, bootsnap-1.18.3, sendgrid-ruby-6.7.0, devise-4.9.4,
remote:        letter_opener-1.10.0, activerecord-7.1.3.4, actiontext-7.1.3.4,
remote:        htmlbeautifier-1.4.3, base64-0.2.0, bigdecimal-3.1.8, mutex_m-0.2.0,
remote:        tailwindcss-rails-2.6.1, actioncable-7.1.3.4, actionmailbox-7.1.3.4,
remote:        actionmailer-7.1.3.4, actionpack-7.1.3.4, actionview-7.1.3.4, activejob-7.1.3.4,
remote:        activemodel-7.1.3.4, activestorage-7.1.3.4, activesupport-7.1.3.4,
remote:        railties-7.1.3.4, sprockets-4.2.1, nio4r-2.7.3, tzinfo-2.0.6, msgpack-1.7.2,
remote:        ruby_http_client-3.5.5, bcrypt-3.1.20, responders-3.1.1, launchy-3.0.1,
remote:        timeout-0.4.1, globalid-1.2.1, nokogiri-1.16.6, mini_magick-4.13.1,
remote:        ruby-vips-2.2.1, websocket-driver-0.7.6, zeitwerk-2.6.16, mail-2.8.1,
remote:        net-imap-0.4.14, net-smtp-0.5.0, rails-dom-testing-2.2.0, racc-1.8.0,
remote:        rack-3.1.6, rack-session-2.0.0, rack-test-2.1.0, rails-html-sanitizer-1.6.0,
remote:        builder-3.3.0, erubi-1.13.0, marcel-1.0.4, concurrent-ruby-1.3.3,
remote:        connection_pool-2.4.1, drb-2.2.1, i18n-1.14.5, minitest-5.24.1, irb-1.13.2,
remote:        rackup-2.1.0, rake-13.2.1, thor-1.3.1, addressable-2.8.7, childprocess-5.0.0,
remote:        mini_portile2-2.8.7, ffi-1.17.0, mini_mime-1.1.5, date-3.3.4,
remote:        net-protocol-0.2.2, loofah-2.22.0, rdoc-6.7.0, reline-0.5.9, webrick-1.8.1,
remote:        public_suffix-6.0.0, psych-5.1.2, io-console-0.7.2, stringio-3.1.1 in cached
remote:        gems or installed locally
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 *****.
remote: 
To https://git.heroku.com/*****.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/*****.git'

我已经尝试了这个问题上找到的解决方案,但没有任何效果(我得到了同样的错误)。一切在我的本地机器上运行良好,所以我不知道为什么它在 Heroku 上不起作用。

我还想问:您是否应该从本地服务器或应用程序的heroku shell 运行在这个问题上找到的命令?因为我尝试从heroku shell运行命令但无济于事:

$ heroku run bash --app *****
Running bash on ⬢ *****... up, run.4316 (Basic)
~ $ bundle install
bash: bundle: command not found
ruby-on-rails ruby heroku rubygems
1个回答
0
投票

接近他。他是 ROR 开发人员 https://www. Fiverr.com/users/abr101

© www.soinside.com 2019 - 2024. All rights reserved.