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

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

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

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

Heroku

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

Ruby on Rails

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

Q&A

解決済

1回答

1112閲覧

Herokuにデプロイできません。(rails)

shushiO

総合スコア12

Ruby on Rails 5

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

Heroku

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

Ruby on Rails

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

0グッド

0クリップ

投稿2019/07/20 13:56

編集2019/07/20 15:03

#Herokuにデプロイしたら以下のようなエラーが出てきてできませんでした。
git push heroku masterした後以下のエラーが出てきました。

Enumerating objects: 134, done. Counting objects: 100% (134/134), done. Delta compression using up to 4 threads Compressing objects: 100% (117/117), done. Writing objects: 100% (134/134), 50.76 KiB | 1.59 MiB/s, done. Total 134 (delta 8), reused 0 (delta 0) remote: Compressing source files... done. remote: Building source: remote: 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: -----> Compiling Ruby/Rails remote: -----> Using Ruby version: ruby-2.5.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: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. remote: Fetching gem metadata from https://rubygems.org/............ remote: Fetching rake 12.3.2 remote: Installing rake 12.3.2 略。。。 remote: Bundle complete! 21 Gemfile dependencies, 64 gems now installed. remote: Gems in the groups development and test were not installed. remote: Bundled gems are installed into `./vendor/bundle` remote: Post-install message from i18n: remote: remote: HEADS UP! i18n 1.1 changed fallbacks to exclude default locale. remote: But that may break your application. remote: remote: Please check your Rails app for 'config.i18n.fallbacks = true'. remote: If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be remote: 'config.i18n.fallbacks = [I18n.default_locale]'. remote: If not, fallbacks will be broken in your app by I18n 1.1.x. remote: remote: For more info see: remote: https://github.com/svenfuchs/i18n/releases/tag/v1.1.0 remote: remote: Post-install message from sass: remote: remote: Ruby Sass has reached end-of-life and should no longer be used. remote: remote: * If you use Sass as a command-line tool, we recommend using Dart Sass, the new remote: primary implementation: https://sass-lang.com/install remote: remote: * If you use Sass as a plug-in for a Ruby web framework, we recommend using the remote: sassc gem: https://github.com/sass/sassc-ruby#readme remote: remote: * For more details, please refer to the Sass blog: remote: https://sass-lang.com/blog/posts/7828841 remote: remote: Bundle completed (46.16s) remote: Cleaning up the bundler cache. remote: -----> Installing node-v10.15.3-linux-x64 remote: -----> Detecting rake tasks remote: remote: ! remote: ! Could not detect rake tasks remote: ! ensure you can run `$ bundle exec rake -P` against your app remote: ! and using the production group of your Gemfile. remote: ! Activating bundler (2.0.1) failed: remote: ! Could not find 'bundler' (2.0.1) required by your /tmp/build_6cc6248f6174f755808dc4c0d9760448/Gemfile.lock. remote: ! To update to the latest version installed on your system, run `bundle update --bundler`. remote: ! To install the missing version, run `gem install bundler:2.0.1` remote: ! Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information remote: ! remote: ! To install the version of bundler this project requires, run `gem install bundler -v '2.0.1'` remote: ! remote: /app/tmp/buildpacks/b7af5642714be4eddaa5f35e2b4c36176b839b4abcd9bfe57ee71c358d71152b4fd2cf925c5b6e6816adee359c4f0f966b663a7f8649b0729509d510091abc07/lib/language_pack/helpers/rake_runner.rb:106:in `load_rake_tasks!': Could not detect rake tasks (LanguagePack::Helpers::RakeRunner::CannotLoadRakefileError) remote: ensure you can run `$ bundle exec rake -P` against your app remote: and using the production group of your Gemfile. remote: Activating bundler (2.0.1) failed: remote: Could not find 'bundler' (2.0.1) required by your /tmp/build_6cc6248f6174f755808dc4c0d9760448/Gemfile.lock. remote: To update to the latest version installed on your system, run `bundle update --bundler`. remote: To install the missing version, run `gem install bundler:2.0.1` remote: Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute `gem env` for more information remote: remote: To install the version of bundler this project requires, run `gem install bundler -v '2.0.1'` remote: from 略。。。 remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to xxx. remote: To ssh://heroku.com/xxx ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'ssh://git@heroku.com/xxx'

#試したこと
Gemfile を以下のように修正し bundle installしました。
以下は今のGemfileの中身です。

Gemfile

1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.5.3' 5 6gem "jquery-rails" 7# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 8gem 'rails', '~> 5.2.2' 9# Use sqlite3 as the database for Active Record 10 11# Use Puma as the app server 12gem 'puma', '~> 3.11' 13# Use SCSS for stylesheets 14gem 'sass-rails', '~> 5.0' 15# Use Uglifier as compressor for JavaScript assets 16gem 'uglifier', '>= 1.3.0' 17# See https://github.com/rails/execjs#readme for more supported runtimes 18# gem 'mini_racer', platforms: :ruby 19 20# Use CoffeeScript for .coffee assets and views 21gem 'coffee-rails', '~> 4.2' 22# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 23gem 'turbolinks', '~> 5' 24# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 25gem 'jbuilder', '~> 2.5' 26# Use Redis adapter to run Action Cable in production 27# gem 'redis', '~> 4.0' 28# Use ActiveModel has_secure_password 29# gem 'bcrypt', '~> 3.1.7' 30 31# Use ActiveStorage variant 32# gem 'mini_magick', '~> 4.8' 33 34# Use Capistrano for deployment 35# gem 'capistrano-rails', group: :development 36 37# Reduces boot times through caching; required in config/boot.rb 38gem 'bootsnap', '>= 1.1.0', require: false 39 40group :development, :test do 41 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 42 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 43end 44 45group :development do 46 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 47 gem 'web-console', '>= 3.3.0' 48 gem 'listen', '>= 3.0.5', '< 3.2' 49 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 50 gem 'spring' 51 gem 'spring-watcher-listen', '~> 2.0.0' 52 gem 'sqlite3', '~> 1.3.6' 53end 54 55group :test do 56 # Adds support for Capybara system testing and selenium driver 57 gem 'capybara', '>= 2.15' 58 gem 'selenium-webdriver' 59 # Easy installation and use of chromedriver to run system tests with Chrome 60 gem 'chromedriver-helper' 61end 62 63group :production do 64 gem 'pg', '0.17.1' 65 gem 'rails_12factor', '0.0.2' 66end 67# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 68gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 69

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

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

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

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

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

guest

回答1

0

ベストアンサー

remote: ! Could not detect rake tasks
remote: ! ensure you can run $ bundle exec rake -P against your app
remote: ! and using the production group of your Gemfile.
remote: ! Activating bundler (2.0.1) failed:
remote: ! Could not find 'bundler' (2.0.1) required by your /tmp/build_6cc6248f6174f755808dc4c0d9760448/Gemfile.lock.
remote: ! To update to the latest version installed on your system, run bundle update --bundler.
remote: ! To install the missing version, run gem install bundler:2.0.1
remote: ! Checked in 'GEM_PATH=vendor/bundle/ruby/2.5.0', execute gem env for more information
remote: !
remote: ! To install the version of bundler this project requires, run `gem install bundler -v '2.0.1'

bundler のバージョンの問題のようです。

※分かりづらいですが、「!」が付いている行がエラーメッセージです。

投稿2019/07/23 06:49

nskydiving

総合スコア6500

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

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

shushiO

2019/08/13 03:29

ありがとうございます!bindle のバージョンを調べたところ問題がなかったようですが、gem 'pg'のバージョンを変更したところでデプロイできました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問