问题描述
我认为第一是造成后者的原因。但是我在“源文件”中找不到有关如何获取gem aws-eventstream-1.1.0的任何适当信息。我只是遵循Michael Hartl的Ruby-on-Rails课程。 Michael Hartl认为这与AWS配置有关。 因此,如果有一种方法可以在部署之前检查配置是否良好,将非常方便。是否存在?
由于本课程将仅使用此AWS账户,因此我将共享配置数据:
cli:
➜ sample_app git:(following-users)$ heroku config:set \
AWS_ACCESS_KEY_ID=AKIAXOOFOGFFI62ZSAJR \
AWS_SECRET_ACCESS_KEY=WI2ez9rn16SgqmkFcV9CsUt9hqLkpf49iktsKpa+ \
AWS_REGION=eu-central-1 \
AWS_BUCKET=rails-tutorial-josufst-1
storage.yml
test:
service: disk
root: <%= Rails.root.join("tmp/storage") %>
local:
service: disk
root: <%= Rails.root.join("storage") %>
amazon:
service: S3
access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %>
secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %>
region: <%= ENV['AWS_REGION'] %>
bucket: <%= ENV['AWS_BUCKET'] %>
下面,我发布了Gemfile和Gemfile.lock和.gitignore。
aws-eventstream-1.1.0似乎存在于Gemfile.lock中。
我试图做:
bundle install
bundle update
git add -A
git commit -m "whatever I tried"
git push heroku user-microposts:master
我也可以在本地运行该应用程序,并在本地运行所有测试。一切正常。 据我所知,我遵循了Ruby on Rails教程中的所有步骤。
现在我尝试使用git push -f heroku user-microposts:master
(强制)来查看它是否与“挂钩”有关。虽然,作为一个新手,我不理解钩子的概念。
➜ sample_app git:(user-microposts) git push -f heroku user-microposts:master
Enumerating objects: 1525,done.
Counting objects: 100% (1525/1525),done.
Delta compression using up to 4 threads
Compressing objects: 100% (1307/1307),done.
Writing objects: 100% (1394/1394),4.90 MiB | 65.00 KiB/s,done.
Total 1394 (delta 310),reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.0.2
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.6.3
remote: -----> Installing dependencies using bundler 2.0.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find aws-eventstream-1.1.0 in any of the sources
remote: Bundler Output: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find aws-eventstream-1.1.0 in any of the sources
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 rails-tutorial-josufst.
remote:
To https://git.heroku.com/rails-tutorial-josufst.git
! [remote rejected] user-microposts -> master (pre-receive hook declined)
error: Failed to push some refs to 'https://git.heroku.com/rails-tutorial-josufst.git'
宝石文件
source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem 'rails','6.0.3.2'
gem 'image_processing','1.9.3'
gem 'mini_magick','4.9.5'
gem 'active_storage_validations','0.8.9'
gem 'bcrypt','3.1.13'
gem 'faker','2.11.0'
gem 'will_paginate','3.3.0'
gem 'bootstrap-will_paginate','1.0.0'
gem 'bootstrap-sass','3.4.1'
gem 'puma','4.3.5'
gem 'sass-rails','6.0.0'
gem 'webpacker','4.2.2'
gem 'turbolinks','5.2.1'
gem 'jbuilder','2.10.0'
gem 'bootsnap','1.4.6',require: false
group :development,:test do
gem 'sqlite3','1.4.2'
gem 'byebug','11.1.3',platforms: [:mri,:mingw,:x64_mingw]
end
group :development do
gem 'web-console','4.0.2'
gem 'listen','3.2.1'
gem 'spring','2.1.0'
gem 'spring-watcher-listen','2.0.1'
end
group :test do
gem 'capybara','3.32.2'
gem 'selenium-webdriver','3.142.7'
gem 'webdrivers','4.3.0'
gem 'rails-controller-testing','1.0.4'
gem 'minitest','5.11.3'
gem 'minitest-reporters','1.3.8'
gem 'guard','2.16.2'
gem 'guard-minitest','2.4.6'
end
group :production do
gem 'pg','1.2.3'
gem 'aws-sdk-s3','1.46.0',require: false
end
# Windows does not include zoneinfo files,so bundle the tzinfo-data gem
# Uncomment the following line if you're running Rails
# on a native Windows system:
# gem 'tzinfo-data',platforms: [:mingw,:mswin,:x64_mingw,:jruby]
Gemfile.lock
GEM
remote: https://rubygems.org/
specs:
actioncable (6.0.3.2)
actionpack (= 6.0.3.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailBox (6.0.3.2)
actionpack (= 6.0.3.2)
activejob (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
mail (>= 2.7.1)
actionmailer (6.0.3.2)
actionpack (= 6.0.3.2)
actionview (= 6.0.3.2)
activejob (= 6.0.3.2)
mail (~> 2.5,>= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.3.2)
actionview (= 6.0.3.2)
activesupport (= 6.0.3.2)
rack (~> 2.0,>= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0,>= 1.2.0)
actiontext (6.0.3.2)
actionpack (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
nokogiri (>= 1.8.5)
actionview (6.0.3.2)
activesupport (= 6.0.3.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1,>= 1.2.0)
active_storage_validations (0.8.9)
rails (>= 5.2.0)
activejob (6.0.3.2)
activesupport (= 6.0.3.2)
globalid (>= 0.3.6)
activemodel (6.0.3.2)
activesupport (= 6.0.3.2)
activerecord (6.0.3.2)
activemodel (= 6.0.3.2)
activesupport (= 6.0.3.2)
activestorage (6.0.3.2)
actionpack (= 6.0.3.2)
activejob (= 6.0.3.2)
activerecord (= 6.0.3.2)
marcel (~> 0.3.1)
activesupport (6.0.3.2)
concurrent-ruby (~> 1.0,>= 1.0.2)
i18n (>= 0.7,< 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2,>= 2.2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2,< 5.0)
ansi (1.5.0)
autoprefixer-rails (9.8.6.3)
execjs
aws-eventstream (1.1.0)
aws-partitions (1.364.0)
aws-sdk-core (3.105.0)
aws-eventstream (~> 1,>= 1.0.2)
aws-partitions (~> 1,>= 1.239.0)
aws-sigv4 (~> 1.1)
jmespath (~> 1.0)
aws-sdk-kms (1.37.0)
aws-sdk-core (~> 3,>= 3.99.0)
aws-sigv4 (~> 1.1)
aws-sdk-s3 (1.46.0)
aws-sdk-core (~> 3,>= 3.61.1)
aws-sdk-kms (~> 1)
aws-sigv4 (~> 1.1)
aws-sigv4 (1.2.2)
aws-eventstream (~> 1,>= 1.0.2)
bcrypt (3.1.13)
bindex (0.8.1)
bootsnap (1.4.6)
msgpack (~> 1.0)
bootstrap-sass (3.4.1)
autoprefixer-rails (>= 5.2.1)
sassc (>= 2.0.0)
bootstrap-will_paginate (1.0.0)
will_paginate
builder (3.2.4)
byebug (11.1.3)
capybara (3.32.2)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
childprocess (3.0.0)
coderay (1.1.3)
concurrent-ruby (1.1.7)
crass (1.0.6)
erubi (1.9.0)
execjs (2.7.0)
faker (2.11.0)
i18n (>= 1.6,< 2)
ffi (1.13.1)
formatador (0.2.5)
globalid (0.4.2)
activesupport (>= 4.2.0)
guard (2.16.2)
formatador (>= 0.2.4)
listen (>= 2.7,< 4.0)
lumberjack (>= 1.0.12,< 2.0)
nenv (~> 0.1)
notiffany (~> 0.0)
pry (>= 0.9.12)
shellany (~> 0.0)
thor (>= 0.18.1)
guard-compat (1.2.1)
guard-minitest (2.4.6)
guard-compat (~> 1.2)
minitest (>= 3.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
image_processing (1.9.3)
mini_magick (>= 4.9.5,< 5)
ruby-vips (>= 2.0.13,< 3)
jbuilder (2.10.0)
activesupport (>= 5.0.0)
jmespath (1.4.0)
listen (3.2.1)
rb-fsevent (~> 0.10,>= 0.10.3)
rb-inotify (~> 0.9,>= 0.9.10)
loofah (2.7.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
lumberjack (1.2.8)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (1.0.0)
mimemagic (0.3.5)
mini_magick (4.9.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.11.3)
minitest-reporters (1.3.8)
ansi
builder
minitest (>= 5.0)
ruby-progressbar
msgpack (1.3.3)
nenv (0.3.0)
nio4r (2.5.2)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
notiffany (0.1.3)
nenv (~> 0.1)
shellany (~> 0.0)
pg (1.2.3)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
puma (4.3.5)
nio4r (~> 2.0)
rack (2.2.3)
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
rack (>= 1.0,< 3)
rails (6.0.3.2)
actioncable (= 6.0.3.2)
actionmailBox (= 6.0.3.2)
actionmailer (= 6.0.3.2)
actionpack (= 6.0.3.2)
actiontext (= 6.0.3.2)
actionview (= 6.0.3.2)
activejob (= 6.0.3.2)
activemodel (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
bundler (>= 1.3.0)
railties (= 6.0.3.2)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.4)
actionpack (>= 5.0.1.x)
actionview (>= 5.0.1.x)
activesupport (>= 5.0.1.x)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.0.3.2)
actionpack (= 6.0.3.2)
activesupport (= 6.0.3.2)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3,< 2.0)
rake (13.0.1)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (1.7.1)
ruby-progressbar (1.10.1)
ruby-vips (2.0.17)
ffi (~> 1.9)
rubyzip (2.3.0)
sass-rails (6.0.0)
sassc-rails (~> 2.1,>= 2.1.1)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
selenium-webdriver (3.142.7)
childprocess (>= 0.5,< 4.0)
rubyzip (>= 1.2.2)
shellany (0.0.1)
spring (2.1.0)
spring-watcher-listen (2.0.1)
listen (>= 2.7,< 4.0)
spring (>= 1.2,< 3.0)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1,< 3)
sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
thor (1.0.1)
thread_safe (0.3.6)
tilt (2.0.10)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.7)
thread_safe (~> 0.1)
web-console (4.0.2)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
bindex (>= 0.4.0)
railties (>= 6.0.0)
webdrivers (4.3.0)
nokogiri (~> 1.6)
rubyzip (>= 1.3.0)
selenium-webdriver (>= 3.0,< 4.0)
webpacker (4.2.2)
activesupport (>= 4.2)
rack-proxy (>= 0.6.1)
railties (>= 4.2)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
will_paginate (3.3.0)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.4.0)
PLATFORMS
ruby
DEPENDENCIES
active_storage_validations (= 0.8.9)
aws-sdk-s3 (= 1.46.0)
bcrypt (= 3.1.13)
bootsnap (= 1.4.6)
bootstrap-sass (= 3.4.1)
bootstrap-will_paginate (= 1.0.0)
byebug (= 11.1.3)
capybara (= 3.32.2)
faker (= 2.11.0)
guard (= 2.16.2)
guard-minitest (= 2.4.6)
image_processing (= 1.9.3)
jbuilder (= 2.10.0)
listen (= 3.2.1)
mini_magick (= 4.9.5)
minitest (= 5.11.3)
minitest-reporters (= 1.3.8)
pg (= 1.2.3)
puma (= 4.3.5)
rails (= 6.0.3.2)
rails-controller-testing (= 1.0.4)
sass-rails (= 6.0.0)
selenium-webdriver (= 3.142.7)
spring (= 2.1.0)
spring-watcher-listen (= 2.0.1)
sqlite3 (= 1.4.2)
turbolinks (= 5.2.1)
web-console (= 4.0.2)
webdrivers (= 4.3.0)
webpacker (= 4.2.2)
will_paginate (= 3.3.0)
BUNDLED WITH
2.1.4
.gitignore
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system,you probably want to add a global ignore instead:
# git config --global core.excludesfile '~/.gitignore_global'
# Ignore bundler config.
/.bundle
# Ignore the default sqlite database.
/db/*.sqlite3
/db/*.sqlite3-journal
/db/*.sqlite3-*
# Ignore all logfiles and tempfiles.
/log/*
/tmp/*
!/log/.keep
!/tmp/.keep
# Ignore pidfiles,but keep the directory.
/tmp/pids/*
!/tmp/pids/
!/tmp/pids/.keep
# Ignore uploaded files in development.
/storage/*
!/storage/.keep
/public/assets
.byebug_history
# Ignore master key for decrypting credentials and more.
/config/master.key
/public/packs
/public/packs-test
/node_modules
/yarn-error.log
yarn-debug.log*
.yarn-integrity
# Ignore vendor/bundle
/vendor/bundle
解决方法
正如您所说,这是导致您已阅读其他错误报告的第一个错误。因此,我们应该专注于此。具体来说,我们将专注于这一部分。
remote: -----> Installing dependencies using bundler 2.0.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find aws-eventstream-1.1.0 in any of the sources
remote: Bundler Output: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find aws-eventstream-1.1.0 in any of the sources
此代码段是Bundler在Heroku上运行并失败。
使用容器(这是Heroku在容器上运行应用程序的容器。容器是计算机中的虚拟计算机)时的良好调试习惯,以便首先使失败的事物在本地运行首先在您的本机上(无论您进行了什么开发)。这样做是一种很好的调试方法,因为它可以简化可能出现的问题,并且通常,如果您可以使其在本地计算机上本地运行,那么它将在容器中运行。
因此,我们正在运行测试。我们需要确保测试与容器中的测试相同。幸运的是,邦德勒是个宝贝,它告诉我们它正在运行什么命令:
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
因此,我们需要使该命令在您的计算机上本地运行。
现在该逐步了解此bundle install
命令的每个组件,并花时间了解它的作用。或在大多数情况下,这是调试的不幸事实。通常需要耐心的缓慢的有条理的工作。
但是,我怀疑我知道这里的答案。注意上面命令中的--deployment
标志选项。 puts Bundler in deployment mode,用于生产用途(默认用于开发用途)。要做的一件事是告诉Bundler不要从rubygems.org(默认)下载宝石,而是从本地目录vendor/cache/
中获取宝石。
我怀疑您在git分支中有一个vendor/cache/
目录,但是它不包含Bundle期望的所有gem。因此,这些来自邦德勒的抱怨。
remote: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find aws-eventstream-1.1.0 in any of the sources
remote: Bundler Output: Some gems seem to be missing from your vendor/cache directory.
remote: Could not find aws-eventstream-1.1.0 in any of the sources
一个选择是删除--deployment
标志,但是我猜这不是一个选择,因为Heroku控制使用什么命令,我们不能更改它。我对Heroku没有任何经验,但是,如果我的更好主意不起作用,我们可以返回并探讨此选项。
所以!我需要你的一些信息。您可以共享您的.gitignore
文件吗?