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

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

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

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

Git

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

Heroku

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

Q&A

2回答

289閲覧

railsのアプリをherokuにpushできない

Piesuke

総合スコア15

Ruby on Rails 5

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

Git

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

Heroku

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

0グッド

0クリップ

投稿2018/12/15 09:56

編集2018/12/17 03:04

SQlite3を開発環境のみにしましたが、herokuにpushする時にもSQlite3のエラーが出て、pushできません。

gemfile

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

database.yml

1 2# 3default: &default 4 adapter: sqlite3 5 pool: 5 6 timeout: 5000 7 8development: 9 <<: *default 10 database: db/development.sqlite3 11 12# Warning: The database defined as "test" will be erased and 13# re-generated from your development database when you run "rake". 14# Do not set this db to the same as development or production. 15test: 16 <<: *default 17 database: db/test.sqlite3 18 19production: 20 <<: *default 21 adapter: postgresql 22 encoding: unicode 23 pool: 5 24

お願いします。

追記

エラー文

remote: An error occurred while installing sqlite3 (1.3.13), and Bundler cannot remote: continue. remote: Make sure that `gem install sqlite3 -v '1.3.13'` succeeds before bundling. remote: ! remote: ! Failed to install gems via Bundler. remote: ! Detected sqlite3 gem which is not supported on Heroku: remote: ! https://devcenter.heroku.com/articles/sqlite3 remote: ! remote: ! Push rejected, failed to compile Ruby app. remote: remote: ! Push failed remote: Verifying deploy... remote: remote: ! Push rejected to hoge-hoge-00000. remote: To https://git.heroku.com/hoge-hoge-00000.git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://git.heroku.com/hoge-hoge-00000.git

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

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

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

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

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

guest

回答2

0

どのようなエラーが出ているのでしょうか?
エラーメッセージは、具体的に記載してください。


エラーメッセージが不明なので、推測して回答すると...

たぶん SQLite 関係の警告と思われるので...

SQLite on Heroku には、

SQLite runs in memory, and backs up its data store in files on disk. While this strategy works well for development, Heroku’s Cedar stack has an ephemeral filesystem. You can write to it, and you can read from it, but the contents will be cleared periodically. If you were to use SQLite on Heroku, you would lose your entire database at least once every 24 hours.

Instead of using SQLite on Heroku you can configure your app to run on Postgres.

という記述がありますので、SQLite を使用する場合に問題が生じるので、警告を出しているのだと思います。

投稿2018/12/17 02:33

編集2018/12/17 02:36
CHERRY

総合スコア25171

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

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

Piesuke

2018/12/17 03:06

エラー文記載しました SQLite をdevelopmentとtestのみ使う設定をしているのにherokuにpushする時にも反映されてしまいます。
guest

0

最新のgitソースがコミットされていない、Gemfileの変更を行った後にbundleを行っていないのかもしれません。

また、 config/database.yml ファイルに <<: *default の行がありますのでdefaultの設定を引き継いでしまいます。

production: adapter: postgresql encoding: unicode pool: 5

のように変更し、念のため Gemfile.lock ファイルを削除し、 bundle install を行った後 add、commitを行い、pushしますといかがでしょうか。

投稿2018/12/16 23:32

編集2018/12/17 03:15
ykp_yk

総合スコア654

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

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

Piesuke

2018/12/17 03:06

試しましたが同じエラーが出ました。
ykp_yk

2018/12/17 03:11 編集

database.yml のproductionの設定に ` <<: *default` の行は不要でしたね。defaultの設定を引き継いでしまいます。 ``` production: adapter: postgresql encoding: unicode pool: 5 ```
Piesuke

2018/12/17 03:32

元々のproductionの設定に<<: *defaultがあったのですが、消した方がいいですか?
ykp_yk

2018/12/17 03:37 編集

はい、そちらは削除してください。 defaultではadapter: sqlite3の行がありますのでその設定を記述しているのと同じ事になります。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

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

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

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問