Trying to push Rails 4.2.1 app to Heroku sqlite error -


so read thread on similar question, still confused. gem file.

i changed sqlite3 gems in gemfile gem 'pg', '0.7.0' changed sqlite3 in database.yml file postgresql. did bundle install, , heroku create, , git push heroku master , had multiple problems trying install sqlite3.

it common run sqlite in development , test , different database postgresql in production. rails makes easy this.

in gemfile, can use groups specify gems should installed in each environment. so, in scenario, gemfile contain like:

group :development, :test   gem 'sqlite3',     '1.3.9' end  group :production   gem 'pg',             '0.17.1' end 

the first time add production gems, should run:

bundle install --without production 

to update gemfile.lock.

similarly, in database.yml, should define sqlite development , test , postgresql production. here example:

default: &default   adapter: sqlite3   pool: 5   timeout: 5000  development:   <<: *default   database: db/development.sqlite3  test:   <<: *default   database: db/test.sqlite3  production:   database: signup   adapter: postgresql   pool: 5   timeout: 5000   username: xxxx   password: yyyy 

finally, make sure commit gemfile changes production before attempt deploy heroku.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -