2017-05-29 7 views
0

これは、初めてHerokuにバックエンドRailsアプリケーションをデプロイしようとしていますが、ActiveRecordに問題があります。奇妙なことは、ActiveRecordが私のアプリケーションでまったく使われていないということです。それは私のGemfileにはなく、私はデータベースを使用していません。私はHerokuのにデプロイする場合は、しかし、私は私のログにこのメッセージが表示されます。Herokuデプロイメントエラー - ActiveRecordを要求しています

2017-05-29T21:07:47.824117+00:00 heroku[web.1]: Starting process with command `bundle exec rails server` 
2017-05-29T21:07:52.180887+00:00 app[web.1]: /app/vendor/bundle/ruby/2.3.0/gems/activerecord-5.0.2/lib/active_record/connection_adapters/connection_specification.rb:176:in `rescue in spec': Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord). (Gem::LoadError)``` 

This leads to a long list of errors and warnings about ActiveRecord, culminating in `2017-05-29T21:10:40.107538+00:00 heroku[web.1]: State changed from starting to crashed` 

followed by `2017-05-29T21:10:40.089176+00:00 heroku[web.1]: Process exited with status 1`. 

After this first failure, the subsequent logs all read: 

```2017-05-29T21:10:39.968550+00:00 app[web.1]:  from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `tap' 
2017-05-29T21:10:39.968551+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:85:in `server' 
2017-05-29T21:10:39.968551+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/commands/commands_tasks.rb:49:in `run_command!' 
2017-05-29T21:10:39.968552+00:00 app[web.1]: from /app/vendor/bundle/ruby/2.3.0/gems/railties-5.0.2/lib/rails/commands.rb:18:in `<top (required)>' 
2017-05-29T21:10:39.968553+00:00 app[web.1]: from bin/rails:9:in `require' 
2017-05-29T21:10:39.968553+00:00 app[web.1]: from bin/rails:9:in `<main>' 
2017-05-29T21:10:39.983313+00:00 app[web.1]: => Booting Puma 
2017-05-29T21:10:39.983318+00:00 app[web.1]: => Rails 5.0.2 application starting in production on http://0.0.0.0:11396 
2017-05-29T21:10:39.983319+00:00 app[web.1]: => Run `rails server -h` for more startup options 
2017-05-29T21:10:39.983320+00:00 app[web.1]: Exiting 
2017-05-29T21:10:40.089176+00:00 heroku[web.1]: Process exited with status 1 

それはHerokuの上でサポートされていないので、私は、しかし、sqlite3宝石をインストールすることはできません。誰でもActiveRecordの要件を削除する方法を知っていますか、それともこのエラーを引き起こす何か他のものですか?

答えて

0

gem 'sqlite3'をGemfileのgem 'pg'に置き換えてください。データベースを必要としないかもしれませんが、Herokuはレールスタックに1つを同梱しています。 Rails自体はActiveRecordを使用していなくても、ActiveRecordでパッケージ化されています。

sqlite3をpgに置き換えると、これを越えてしまいます。

+0

ありがとうございました!私もpostgresqlのためにdatabase.ymlファイルを変更する必要がありました – paoliff

関連する問題