2

I trying to figure out how fix the active record problem so I can push to heroku.

-----> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! ActiveRecord::AdapterNotSpecified: 'postgresql' database is not configured. Available: ["development", "adapter", "encoding", "database", "host", "pool", "username", "password", "production"]

  development:
  adapter: postgresql
  encoding: unicode
  database: sample_app_development
  host: localhost
  pool: 5
  username: sample_app
  password: 

test:
  adapter: postgresql
  encoding: unicode
  database: sample_app_test
  host: localhost
  pool: 5
  username: sample_app
  password: 


production:
  adapter: postgresql
  encoding: unicode
  database: sample_app_production
  host: localhost
  pool: 5
  username: sample_app
  password: 
1
  • @Amjad nailed it - remove spaces on 1st line in front of " development:" Commented Sep 2, 2016 at 23:11

4 Answers 4

5

There is a space before development in the db config. I believe To fix it, simply remove space from the first line and follow the indentation.

Sign up to request clarification or add additional context in comments.

Comments

1

I think you need to write this command on terminal to create you database:

rake db:create

Then run rake db:migrate to run your migrations

Comments

1
  1. Remove spaces on 1st line " development:"
  2. Make sure of the database name e.g. "sample_app_development" or just "sample_app"
  3. gem install pg
  4. rake db:create
  5. rake db:migrate

1 Comment

It was step #1 above that got me past my hour+ blockade -- didn't know leading spaces were an issue.
0

First install postgresql

gem install pg

Then create project using following command:

rails new myapp -d postgresql

2 Comments

Thanks. I did this process first. My problem began once I did "git push heroku master"
I don't see any problem in your database.yml.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.