質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Q&A

1回答

508閲覧

Herokuへポートフォリオのの情報を追加出来ません。git push heroku master後のエラー解決をお願いいたします!

sn007

総合スコア1

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Git

Gitはオープンソースの分散バージョン管理システム(DVCS)です。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

GitHub

GitHubは、Gitバージョン管理システムを利用したソフトウェア開発向けの共有ウェブサービスです。GitHub商用プランおよびオープンソースプロジェクト向けの無料アカウントを提供しています。

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

0グッド

0クリップ

投稿2021/04/23 14:15

前提・実現したいこと

git push heroku masterを実行して、
Herokuへアプリケーションを追加すること。

##発生している問題・エラーメッセージ
オリジナルアプリを作成しています。
下記のコマンドを実行した所、エラーが発生します。
% git push heroku master

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 xxxx-xxxx.
remote:
To https://git.heroku.com/xxxx-xxxx.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/xxxx-xxxx.git'

該当のソースコード

Ruby

1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.6.5' 5 6# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7gem 'rails', '~> 6.0.0' 8# Use mysql as the database for Active Record 9gem 'mysql2', '>= 0.4.4' 10# Use Puma as the app server 11gem 'puma', '~> 3.11' 12# Use SCSS for stylesheets 13gem 'sass-rails', '~> 5' 14# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker 15gem 'webpacker', '~> 4.0' 16# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 17gem 'turbolinks', '~> 5' 18# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 19gem 'jbuilder', '~> 2.7' 20# Use Redis adapter to run Action Cable in production 21# gem 'redis', '~> 4.0' 22# Use Active Model has_secure_password 23# gem 'bcrypt', '~> 3.1.7' 24 25# Use Active Storage variant 26# gem 'image_processing', '~> 1.2' 27 28# Reduces boot times through caching; required in config/boot.rb 29gem 'bootsnap', '>= 1.4.2', require: false 30 31group :development, :test do 32 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 33 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 34end 35 36group :development do 37 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 38 gem 'web-console', '>= 3.3.0' 39 gem 'listen', '>= 3.0.5', '< 3.2' 40 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 41 gem 'spring' 42 gem 'spring-watcher-listen', '~> 2.0.0' 43end 44 45group :test do 46 # Adds support for Capybara system testing and selenium driver 47 gem 'capybara', '>= 2.15' 48 gem 'selenium-webdriver' 49 # Easy installation and use of web drivers to run system tests with browsers 50 gem 'webdrivers' 51end 52 53# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 54gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 55 56group :development do 57 gem 'rubocop', require: false 58end 59 60gem 'active_hash' 61 62 63gem 'devise' 64 65 66gem 'pry-rails'

試したこと

二点。

・Gemfile.lockが下記の状態であることを確認。
RUBY VERSION
ruby 2.6.5p114

BUNDLED WITH
2.1.4

・下記コマンドを実行して、Herokuで利用するStackを指定。
heroku stack:set heroku-20 -a

補足情報(FW/ツールのバージョンなど)

予想としてはbundlerのバーションを2.2.5→2.1.4へ下げ流必要がある。

言い方をかえるとHeroku環境のbundlerのversionとローカル環境のbundlerのversionを一致させた。今回の場合は、Herokuのbundlerが2.1.4だったけど、ローカルでは2.2.5だったため、Herokuにpushした際にエラーが発生した。

ローカル環境のbundlerのversion変更方法が分かりません。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

mather

2021/04/23 14:32

エラーメッセージはそれで全てですか? bundle install を実行している部分のログは出力されていませんか?
sn007

2021/04/24 07:46

ご返信ありがとうございます。 その他のエラーメッセージはこちらです。ご確認お願い致します。 Enumerating objects: 248, done. Counting objects: 100% (248/248), done. Delta compression using up to 4 threads Compressing objects: 100% (224/224), done. Writing objects: 100% (248/248), 305.15 KiB | 3.51 MiB/s, done. Total 248 (delta 71), reused 0 (delta 0), pack-reused 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.6.5 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: Fetching gem metadata from https://rubygems.org/............ remote: Your bundle is locked to mimemagic (0.3.5) from rubygems repository remote: https://rubygems.org/ or installed locally, but that version can no longer be remote: found in that source. That means the author of mimemagic (0.3.5) has removed it. remote: You'll need to update your bundle to a version other than mimemagic (0.3.5) that remote: hasn't been removed in order to install. remote: Bundler Output: Fetching gem metadata from https://rubygems.org/............ remote: Your bundle is locked to mimemagic (0.3.5) from rubygems repository remote: https://rubygems.org/ or installed locally, but that version can no longer be remote: found in that source. That means the author of mimemagic (0.3.5) has removed it. remote: You'll need to update your bundle to a version other than mimemagic (0.3.5) that remote: hasn't been removed in order to install. remote:
guest

回答1

0

お手元の環境では mimemagic (0.3.5) がインストールされているようですが、現在はすでに利用できないようです。

remote: Your bundle is locked to mimemagic (0.3.5) from rubygems repository remote: https://rubygems.org/ or installed locally, but that version can no longer be remote: found in that source. That means the author of mimemagic (0.3.5) has removed it.

詳しいことは mimemagic でググってみると良いのですが、以下のページがヒットします。
https://hackmd.io/@mametter/mimemagic-info-ja

簡単な対処法は Rails のバージョンを更新することです。

投稿2021/04/24 13:04

mather

総合スコア6753

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問