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

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

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

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

Ruby on Rails 6

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

Heroku

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

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

Q&A

解決済

2回答

2099閲覧

herokuにデプロイできません(NoMethodError)

haru_ren

総合スコア48

Ruby

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

Ruby on Rails 6

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

Heroku

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

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

0グッド

1クリップ

投稿2020/12/05 12:21

編集2020/12/13 07:24

herokuにデプロイできず詰まっています。

自分で色々と調べ、試したのですが解決せずどの様に解決したらいいのか分かりません...

現状は下記の通りです。

■スペック
・mac os
・Rails 6.0.3.4
・ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin19]

■試したこと
・コミットしていることを確認。
・herokuアプリを削除し、再度作り直しました。
・エラーメッセージにあるgit push heroku ブランチ名:mainコマンドを実行。
→git push heroku master:main
→git push heroku develop:main
どちらも同じエラーが出てデプロイできませんでした...

お手数おかけしますが、何卒よろしくお願いいたします。

■エラーメッセージ(git push heroku master後)

Enumerating objects: 9414, done. Counting objects: 100% (9414/9414), done. Delta compression using up to 8 threads Compressing objects: 100% (8045/8045), done. Writing objects: 100% (9414/9414), 31.47 MiB | 567.00 KiB/s, done. Total 9414 (delta 2551), reused 6930 (delta 849), pack-reused 0 remote: Compressing source files... done. remote: Building source: remote: remote: -----> Node.js app detected remote: remote: -----> Creating runtime environment remote: remote: NPM_CONFIG_LOGLEVEL=error remote: USE_YARN_CACHE=true remote: NODE_ENV=production remote: NODE_MODULES_CACHE=true remote: NODE_VERBOSE=false remote: remote: -----> Installing binaries remote: engines.node (package.json): unspecified remote: engines.npm (package.json): unspecified (use default) remote: engines.yarn (package.json): unspecified (use default) remote: remote: Resolving node version 12.x... remote: Downloading and installing node 12.20.0... remote: Using default npm version: 6.14.8 remote: Resolving yarn version 1.22.x... remote: Downloading and installing yarn (1.22.10) remote: Installed yarn 1.22.10 remote: remote: -----> Installing dependencies remote: Installing node modules (yarn.lock) remote: yarn install v1.22.10 remote: [1/4] Resolving packages... remote: [2/4] Fetching packages... remote: info fsevents@2.1.3: The platform "linux" is incompatible with this module. remote: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. remote: info fsevents@1.2.13: The platform "linux" is incompatible with this module. remote: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. remote: [3/4] Linking dependencies... remote: warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". remote: warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0". remote: [4/4] Building fresh packages... remote: Done in 34.94s. remote: remote: -----> Build remote: remote: -----> Pruning devDependencies remote: yarn install v1.22.10 remote: [1/4] Resolving packages... remote: [2/4] Fetching packages... remote: info fsevents@2.1.3: The platform "linux" is incompatible with this module. remote: info "fsevents@2.1.3" is an optional dependency and failed compatibility check. Excluding it from installation. remote: info fsevents@1.2.13: The platform "linux" is incompatible with this module. remote: info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation. remote: [3/4] Linking dependencies... remote: warning " > webpack-dev-server@3.11.0" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0". remote: warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@^4.0.0". remote: [4/4] Building fresh packages... remote: warning Ignored scripts due to flag. remote: Done in 6.71s. remote: remote: -----> Caching build remote: - yarn cache remote: remote: -----> Build succeeded! remote: ! Unmet dependencies don't fail yarn install but may cause runtime issues remote: https://github.com/npm/npm/issues/7494 remote: remote: -----> Ruby app detected remote: -----> Installing bundler 2.1.4 remote: -----> Removing BUNDLED WITH version in the Gemfile.lock remote: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.6.6 remote: -----> Installing dependencies using bundler 2.1.4 remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin BUNDLE_DEPLOYMENT=1 bundle install -j4 remote: /tmp/build_7d30a02c/bin/bundle:34:in `gemfile': undefined method `present?' for "/tmp/build_7d30a02c/Gemfile":String (NoMethodError) remote: from /tmp/build_7d30a02c/bin/bundle:41:in `lockfile' remote: from /tmp/build_7d30a02c/bin/bundle:49:in `lockfile_version' remote: from /tmp/build_7d30a02c/bin/bundle:58:in `bundler_version' remote: from /tmp/build_7d30a02c/bin/bundle:62:in `bundler_requirement' remote: from /tmp/build_7d30a02c/bin/bundle:89:in `activate_bundler' remote: from /tmp/build_7d30a02c/bin/bundle:78:in `load_bundler!' remote: from /tmp/build_7d30a02c/bin/bundle:102:in `<main>' remote: Bundler Output: /tmp/build_7d30a02c/bin/bundle:34:in `gemfile': undefined method `present?' for "/tmp/build_7d30a02c/Gemfile":String (NoMethodError) remote: from /tmp/build_7d30a02c/bin/bundle:41:in `lockfile' remote: from /tmp/build_7d30a02c/bin/bundle:49:in `lockfile_version' remote: from /tmp/build_7d30a02c/bin/bundle:58:in `bundler_version' remote: from /tmp/build_7d30a02c/bin/bundle:62:in `bundler_requirement' remote: from /tmp/build_7d30a02c/bin/bundle:89:in `activate_bundler' remote: from /tmp/build_7d30a02c/bin/bundle:78:in `load_bundler!' remote: from /tmp/build_7d30a02c/bin/bundle:102:in `<main>' 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 music-sns-app. remote: To https://git.heroku.com/music-sns-app.git ! [remote rejected] heroku_deploy_error -> main (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/music-sns-app.git'

■heroku logs

Build failed -- check your build output:URL

gemfile

1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.6.6' 5 6gem 'rails', '~> 6.0.3', '>= 6.0.3.3' 7gem 'bcrypt' 8gem 'puma', '~> 4.1' 9gem 'sass-rails', '>= 6' 10gem 'webpacker', '~> 4.0' 11gem 'turbolinks', '~> 5' 12gem 'jbuilder', '~> 2.7' 13gem 'bootsnap', '>= 1.4.2', require: false 14gem 'bootstrap-sass' 15gem 'devise' 16gem 'faker' 17gem 'jquery-rails' 18gem 'will_paginate' 19gem 'bootstrap-will_paginate' 20 21group :development, :test do 22 gem "factory_bot_rails" 23 gem 'rubocop-airbnb' 24 gem 'rails-controller-testing' 25 gem 'rspec-rails' 26 gem 'sqlite3' 27 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 28end 29 30group :development do 31 gem 'spring-commands-rspec' 32 gem 'web-console', '>= 3.3.0' 33 gem 'listen', '~> 3.2' 34 gem 'spring' 35 gem 'spring-watcher-listen', '~> 2.0.0' 36end 37 38group :test do 39 gem 'webdrivers' 40 gem 'capybara', '>= 2.15' 41 gem 'selenium-webdriver' 42end 43 44group :production do 45 gem 'pg' 46end 47 48gem 'tzinfo-data'

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

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

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

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

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

guest

回答2

0

自己解決

本件解決いたしました!
bin/bundleファイルにエラーが発生していた様なので修正したところ無事デプロイすることができました。

投稿2020/12/17 15:15

haru_ren

総合スコア48

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

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

0

https://qiita.com/seiya2130/items/999b5512fa5aa7121784
こちらの記事に同じようなエラーでて、投稿者様は解決できたようなので参考にしてみてはいかたでしょうか?(push前にbundle install

投稿2020/12/17 08:28

GenkiSugiyama

総合スコア86

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問