プログラミング初心者です。
git push heroku masterを実行してHerokuにデプロイしたいのですが、
エラー続きで困ってしまっております。
どなたかご教示いただけますと幸いです。
git push heroku masterを実行した結果
Enumerating objects: 2637, done. Counting objects: 100% (2637/2637), done. Delta compression using up to 4 threads Compressing objects: 100% (2498/2498), done. Writing objects: 100% (2637/2637), 13.82 MiB | 87.00 KiB/s, done. Total 2637 (delta 216), 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: grep: /tmp/build_95e57356/Gemfile.lock: No such file or directory remote: -----> Compiling Ruby/NoLockfile remote: remote: ! remote: ! Gemfile.lock required. Please check it in. remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to polar-citadel-69285. remote: To https://git.heroku.com/polar-citadel-69285.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/polar-citadel-69285.git'
エラー文を読むと、「Gemfile.lockが必要」と書いてありました。
調べたところ、
bundle installを実行した際にBundlerがGemfile.lockを生成するということがわかったため、bundle installを実行しました。
bundle installを実行した結果
Fetching gem metadata from https://rubygems.org/............ Resolving dependencies..... Using rake 13.0.3 Using concurrent-ruby 1.1.8 Using minitest 5.14.4 Using zeitwerk 2.4.2 Using builder 3.2.4 Using erubi 1.10.0 Using racc 1.5.2 Using crass 1.0.6 Using rack 2.2.3 Using nio4r 2.5.7 Using websocket-extensions 0.1.5 Fetching mini_mime 1.0.3 Fetching bindex 0.8.1 Fetching public_suffix 4.0.6 Fetching msgpack 1.4.2 Installing bindex 0.8.1 with native extensions Installing mini_mime 1.0.3 Using bundler 2.2.11 Installing msgpack 1.4.2 with native extensions Installing public_suffix 4.0.6 Fetching byebug 11.1.3 Installing byebug 11.1.3 with native extensions Fetching childprocess 3.0.0 Fetching regexp_parser 2.1.1 Installing childprocess 3.0.0 Installing regexp_parser 2.1.1 Fetching ffi 1.15.0 Fetching method_source 1.0.0 Fetching rb-fsevent 0.10.4 Fetching thor 1.1.0 Installing method_source 1.0.0 Fetching rubyzip 2.3.0 Installing rb-fsevent 0.10.4 Fetching tilt 2.0.10 Installing rubyzip 2.3.0 Fetching semantic_range 3.0.0 Installing tilt 2.0.10 Installing thor 1.1.0 Fetching spring 2.1.1 Installing semantic_range 3.0.0 Fetching sqlite3 1.4.2 Fetching turbolinks-source 5.2.0 Installing turbolinks-source 5.2.0 Using i18n 1.8.9 Using tzinfo 2.0.4 Using nokogiri 1.11.2 (x86_64-darwin) Using rack-test 1.1.0 Using websocket-driver 0.7.3 Fetching puma 5.2.2 Installing sqlite3 1.4.2 with native extensions Installing spring 2.1.1 Installing puma 5.2.2 with native extensions Installing ffi 1.15.0 with native extensions Fetching rack-mini-profiler 2.3.1 Installing rack-mini-profiler 2.3.1 Fetching rack-proxy 0.6.5 Fetching mail 2.7.1 Fetching sprockets 4.0.2 Fetching addressable 2.7.0 Installing rack-proxy 0.6.5 Fetching bootsnap 1.7.3 Installing sprockets 4.0.2 Fetching selenium-webdriver 3.142.7 Installing bootsnap 1.7.3 with native extensions Using activesupport 6.1.3 Using loofah 2.9.0 Fetching mimemagic 0.3.9 Installing addressable 2.7.0 Fetching xpath 3.2.0 Installing mimemagic 0.3.9 with native extensions Fetching turbolinks 5.2.1 Installing xpath 3.2.0 Fetching rb-inotify 0.10.1 Installing turbolinks 5.2.1 Fetching sassc 2.4.0 Installing mail 2.7.1 Using rails-dom-testing 2.0.3 Using globalid 0.4.2 Using activemodel 6.1.3 Fetching jbuilder 2.11.2 Installing rb-inotify 0.10.1 Using rails-html-sanitizer 1.3.0 Fetching capybara 3.35.3 Installing jbuilder 2.11.2 Using activejob 6.1.3 Using activerecord 6.1.3 Fetching listen 3.5.0 Installing listen 3.5.0 Using actionview 6.1.3 Using actionpack 6.1.3 Using actioncable 6.1.3 Fetching actionmailer 6.1.3 Installing actionmailer 6.1.3 Fetching railties 6.1.3 Installing sassc 2.4.0 with native extensions Installing railties 6.1.3 Installing capybara 3.35.3 Installing selenium-webdriver 3.142.7 Fetching sprockets-rails 3.2.2 Installing sprockets-rails 3.2.2 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /Users/asamitakaoka/project/my_portfolio/vendor/bundle/ruby/2.7.0/gems/mimemagic-0.3.9/ext/mimemagic /Users/asamitakaoka/.rbenv/versions/2.7.0/bin/ruby -I/Users/asamitakaoka/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems -rrubygems /Users/asamitakaoka/project/my_portfolio/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake RUBYARCHDIR\=/Users/asamitakaoka/project/my_portfolio/vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-19/2.7.0/mimemagic-0.3.9 RUBYLIBDIR\=/Users/asamitakaoka/project/my_portfolio/vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-19/2.7.0/mimemagic-0.3.9 rake aborted! Could not find MIME type database in the following locations: ["/usr/local/share/mime/packages/freedesktop.org.xml", "/opt/homebrew/share/mime/packages/freedesktop.org.xml", "/usr/share/mime/packages/freedesktop.org.xml"] Ensure you have either installed the shared-mime-info package for your distribution, or obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to the location of that file. /Users/asamitakaoka/project/my_portfolio/vendor/bundle/ruby/2.7.0/gems/mimemagic-0.3.9/ext/mimemagic/Rakefile:14:in `locate_mime_database' /Users/asamitakaoka/project/my_portfolio/vendor/bundle/ruby/2.7.0/gems/mimemagic-0.3.9/ext/mimemagic/Rakefile:25:in `block in <top (required)>' /Users/asamitakaoka/project/my_portfolio/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake:27:in `<main>' Tasks: TOP => default (See full trace by running task with --trace) rake failed, exit code 1 Gem files will remain installed in /Users/asamitakaoka/project/my_portfolio/vendor/bundle/ruby/2.7.0/gems/mimemagic-0.3.9 for inspection. Results logged to /Users/asamitakaoka/project/my_portfolio/vendor/bundle/ruby/2.7.0/extensions/x86_64-darwin-19/2.7.0/mimemagic-0.3.9/gem_make.out An error occurred while installing mimemagic (0.3.9), and Bundler cannot continue. Make sure that `gem install mimemagic -v '0.3.9' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: rails was resolved to 6.1.3, which depends on actionmailbox was resolved to 6.1.3, which depends on activestorage was resolved to 6.1.3, which depends on marcel was resolved to 0.3.3, which depends on mimemagic
上記エラー文にあるようにmimemagic (0.3.9)がインストールされていなかったため、
gem install mimemagic -v '0.3.9'を実行しました。
gem install mimemagic -v '0.3.9'を実行した結果
Fetching
1Building native extensions. This could take a while... 2ERROR: Error installing mimemagic: 3 ERROR: Failed to build gem native extension. 4 5 current directory: /Users/asamitakaoka/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/mimemagic-0.3.9/ext/mimemagic 6/Users/asamitakaoka/.rbenv/versions/2.7.0/bin/ruby -I/Users/asamitakaoka/.rbenv/versions/2.7.0/lib/ruby/2.7.0/rubygems -rrubygems /Users/asamitakaoka/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/rake-13.0.3/exe/rake RUBYARCHDIR\=/Users/asamitakaoka/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-19/2.7.0/mimemagic-0.3.9 RUBYLIBDIR\=/Users/asamitakaoka/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-19/2.7.0/mimemagic-0.3.9 7rake aborted! 8Could not find MIME type database in the following locations: ["/usr/local/share/mime/packages/freedesktop.org.xml", "/opt/homebrew/share/mime/packages/freedesktop.org.xml", "/usr/share/mime/packages/freedesktop.org.xml"] 9 10Ensure you have either installed the shared-mime-info package for your distribution, or 11obtain a version of freedesktop.org.xml and set FREEDESKTOP_MIME_TYPES_PATH to the location 12of that file. 13 14Tasks: TOP => default 15(See full trace by running task with --trace) 16 17rake failed, exit code 1 18 19Gem files will remain installed in /Users/asamitakaoka/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/gems/mimemagic-0.3.9 for inspection. 20Results logged to /Users/asamitakaoka/.rbenv/versions/2.7.0/lib/ruby/gems/2.7.0/extensions/x86_64-darwin-19/2.7.0/mimemagic-0.3.9/gem_make.out 21コード
このエラーはどうしたら解決できるのでしょうか。
ネットでエラー文を調べても分からなかったため、
教えていただきたいです。
よろしくお願いいたします。
回答2件
あなたの回答
tips
プレビュー