Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rake migrate fails on passing a string to ActiveRecord::Base.establish_connection #1137

Closed
ilit-all opened this issue Jan 17, 2016 · 3 comments

Comments

@ilit-all
Copy link

When installing according to INSTALLATION.md via Ubuntu 14.04, I get the following error. Does anyone have any idea what causes this?

ilit@ilit-isedc:/opt/osm/openstreetmap-website$ sudo bundle exec rake db:createDEPRECATION WARNING: Passing a string to ActiveRecord::Base.establish_connection for a configuration lookup is deprecated, please pass a symbol (:postgresql) instead. (called from call at /usr/lib/ruby/2.2.0/rake/task.rb:240)
rake aborted!
ActiveRecord::AdapterNotSpecified: 'postgresql' database is not configured. Available: ["development", "adapter", "database", "username", "password", "host", "encoding", "test", "production"]
/var/lib/gems/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:248:in resolve_symbol_connection' /var/lib/gems/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:231:inresolve_string_connection'
/var/lib/gems/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:213:in resolve_connection' /var/lib/gems/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:139:inresolve'
/var/lib/gems/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:151:in block in resolve_all' /var/lib/gems/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:150:ineach'
/var/lib/gems/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_adapters/connection_specification.rb:150:in resolve_all' /var/lib/gems/2.2.0/gems/activerecord-4.2.5/lib/active_record/connection_handling.rb:69:inresolve'
/var/lib/gems/2.2.0/gems/activerecord-4.2.5/lib/active_record/core.rb:46:in configurations=' /var/lib/gems/2.2.0/gems/activerecord-4.2.5/lib/active_record/railties/databases.rake:5:inblock (2 levels) in <top (required)>'
Tasks: TOP => db:create => db:load_config
(See full trace by running task with --trace)
_____________________________________________________-

This error occurs in other calls Rake.

@tomhughes
Copy link
Member

Looks like you haven't setup database.yml correctly, but it's certainly not a bug in our code.

If you need help please use IRC or the mailing list.

@tomhughes
Copy link
Member

Incidentally nothing in the instructions tells you to use sudo when migrating the database and I wouldn't recommend it.

@ilit-all
Copy link
Author

Thank you very much, Tom!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants