I set up my VPS using this tutorial
Everything was fine until I needed manually create dabatase on server using this command:
RAILS_ENV=production bundle exec rake db:create
It gives my this error:
fe_sendauth: no password supplied
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:436:in `new_connection'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `checkout_new_connection'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/home/deploy/.rbenv/versions/2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/home/deploy/.rbenv/versions/2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:565:in `retrieve_connection'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:87:in `connection'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/postgresql_database_tasks.rb:8:in `connection'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/postgresql_database_tasks.rb:17:in `create'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:93:in `create'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:107:in `block in create_current'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:275:in `block in each_current_configuration'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:274:in `each'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:274:in `each_current_configuration'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:106:in `create_current'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:17:in `block (2 levels) in <top (required)>'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/deploy/.rbenv/versions/2.1.5/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/bin/rake:23:in `load'
/home/deploy/liftme/shared/bundle/ruby/2.1.0/bin/rake:23:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"liftme_production"}
My production database.yml configuration:
production:
<<: *default
database: liftme_production
# username: liftme
# password: <%= ENV['LIFTME_DATABASE_PASSWORD'] %>
Even if I uncomment, it still gives me the same error.
Make sure you the LIFTME_DATABASE_PASSWORD environment variable set:
before executing your rake task do this:
$ export LIFTME_DATABASE_PASSWORD=MyUnbreakablePassword
to make sure you have the environment variable set you can use:
$ env | grep LIFTME_DATABASE_PASSWORD
Also read this blog post about managing environment variables in your rails application.
Related
SORRY FOR MY BAD ENGLISH
When i tried to run my local server rails gave me this problem:
ActiveRecord :: ConnectionNotEstablished: FATAL: failed password authentication for user "Blog"
Caused by:
PG :: ConnectionBad: FATAL: failed authentication with password for user "Blog"
But my password was correct and also my username.
HERE MY YAML FILE
default: &default
adapter: postgresql
encoding: unicode
development:
<<: *default
database: Blog_development
encoding: UTF-8
username: Blog
password: Giungla
host: localhost
port: 5432
test:
<<: *default
database: Blog_test
production:
<<: *default
database: Blog_production
username: Blog
password: <%= ENV['BLOG_DATABASE_PASSWORD'] %>
THE TRACE IN MY TERMINAL
** rails db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke db:load_config (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:load_config
** Execute db:migrate
rails aborted!
ActiveRecord::ConnectionNotEstablished: FATALE: autenticazione con password fallita per l'utente "Blog"
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:83:in `rescue in new_client'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:77:in `new_client'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_handling.rb:283:in `connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <main>'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/railties/databases.rake:90:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <main>'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.4/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.4/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.4/lib/rails/commands/rake/rake_command.rb:18:in `perform'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.4/lib/rails/command.rb:50:in `invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.4/lib/rails/commands.rb:18:in `<main>'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
bin/rails:4:in `<main>'
Caused by:
PG::ConnectionBad: FATALE: autenticazione con password fallita per l'utente "Blog"
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/pg-1.2.3-x64-mingw32/lib/pg.rb:58:in `initialize'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/pg-1.2.3-x64-mingw32/lib/pg.rb:58:in `new'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/pg-1.2.3-x64-mingw32/lib/pg.rb:58:in `connect'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:78:in `new_client'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `public_send'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:882:in `new_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:926:in `checkout_new_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:905:in `try_to_checkout_new_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:866:in `acquire_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:588:in `checkout'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:428:in `connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:1128:in `retrieve_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_handling.rb:327:in `retrieve_connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/connection_handling.rb:283:in `connection'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/tasks/database_tasks.rb:237:in `migrate'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/railties/databases.rake:92:in `block (3 levels) in <main>'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/railties/databases.rake:90:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/activerecord-6.1.4/lib/active_record/railties/databases.rake:90:in `block (2 levels) in <main>'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `block in execute'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:281:in `execute'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:219:in `block in invoke_with_call_chain'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `synchronize'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:199:in `invoke_with_call_chain'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/task.rb:188:in `invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:160:in `invoke_task'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block (2 levels) in top_level'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `each'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:116:in `block in top_level'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:125:in `run_with_threads'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:110:in `top_level'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.4/lib/rails/commands/rake/rake_command.rb:24:in `block (2 levels) in perform'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.4/lib/rails/commands/rake/rake_command.rb:24:in `block in perform'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/rake-13.0.6/lib/rake/rake_module.rb:59:in `with_application'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.4/lib/rails/commands/rake/rake_command.rb:18:in `perform'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.4/lib/rails/command.rb:50:in `invoke'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/railties-6.1.4/lib/rails/commands.rb:18:in `<main>'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/bootsnap-1.7.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
bin/rails:4:in `<main>'
Tasks: TOP => db:migrate**
HOW CAN I RESOLVE THIS? I'M NEW IN RAILS AND I'M TRYING TO LEARN IT BUT NOW I'M STUCK
So, your database configuration is correctly being used as your error message mentions the username that it attempted to authenticate with. I don't think there's anything wrong with your database config in Rails, I think the problem may be with a mismatch on your Postgres config.
I would try to attempt to connect to the database with the Postgres CLI client or whatever GUI database client you prefer. Use the same credentials as you have in your Rails config and see if you can get the same error.
How did you create this user in your Postgres database? If you have the SQL statement that may be handy to provide for more detail.
Running rails db:create might be the first command to run to ensure that there's nothing associated with the migration that could complicate things. I would expect that you would get the same error message for that command.
Also, what Rails environment are you using for this command? (development or production for example). Note that the production database config uses the env var BLOG_DATABASE_PASSWORD that may not be set in your shell when you run the rails command. The easiest way to test this in one command is:
$ BLOG_DATABASE_PASSWORD=Giungla rails db:migrate
Of course, you would want your production database password to be different to your development database, this is just an example.
I hope something here helps you solve it!
Login to the Postgresql Database,
psql
alter role blog with password 'secret';
I am trying to use the RVM .ruby-env file to set an environment variable to hold the database password for my project. When I then go to create the database via the RAILS_ENV=production rake db:create command I get an error specifying that the password isn't set: "password"=>nil}.
.ruby-env is located in the root directory of my rails project, and to all accounts as per the RVM website:
This variable will be set when entering the project directory and reverted to its previous value when exiting the project directory.
.ruby-env contents:
VT_DATABASE_PASSWORD=testing1234
config/database.yml contents:
default: &default
adapter: postgresql
encoding: unicode
pool: 5
host: localhost
production:
<<: *default
database: vagrant_test_production
username: lotus
password: <%= ENV['VT_DATABASE_PASSWORD'] %>
Command and error:
vagrant#vagrant-ubuntu-trusty-64:/vagrant/vagrant_test$ RAILS_ENV=production rake db:create
fe_sendauth: no password supplied
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in `initialize'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in `new'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:655:in `connect'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/connection_handling.rb:87:in `connection'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/tasks/postgresql_database_tasks.rb:8:in `connection'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/tasks/postgresql_database_tasks.rb:17:in `create'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/tasks/database_tasks.rb:93:in `create'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/tasks/database_tasks.rb:107:in `block in create_current'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/tasks/database_tasks.rb:275:in `block in each_current_configuration'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/tasks/database_tasks.rb:274:in `each'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/tasks/database_tasks.rb:274:in `each_current_configuration'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/tasks/database_tasks.rb:106:in `create_current'
/home/vagrant/.rvm/gems/ruby-2.2.1/gems/activerecord-4.2.4/lib/active_record/railties/databases.rake:17:in `block (2 levels) in <top (required)>'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/home/vagrant/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/home/vagrant/.rvm/rubies/ruby-2.2.1/bin/rake:33:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "host"=>"localhost", "database"=>"vagrant_test_production", "username"=>"lotus", "password"=>nil}
I think you are just having problems with
ENV['VT_DATABASE_PASSWORD']
the value is just nil (null)
try to add these lines to your config/secrets.yml
production:
VT_DATABASE_PASSWORD: "your db password"
Otherwise you can just try to add the password to the database.yml (that file is not suppose to be in any repository so it's not public
Hello i'm tryng to create a datbase in a ruby on rails application but i've got this error
FATAL: role "giovanni" does not exist
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:661:in `rescue in connect'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:436:in `new_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `checkout_new_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:565:in `retrieve_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:87:in `connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/postgresql_database_tasks.rb:8:in `connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/postgresql_database_tasks.rb:17:in `create'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:93:in `create'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:107:in `block in create_current'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:275:in `block in each_current_configuration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:274:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:274:in `each_current_configuration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:106:in `create_current'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:17:in `block (2 levels) in <top (required)>'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"app_angular_rails_development"}
FATAL: role "giovanni" does not exist
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:661:in `rescue in connect'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:436:in `new_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:446:in `checkout_new_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:565:in `retrieve_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/connection_handling.rb:87:in `connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/postgresql_database_tasks.rb:8:in `connection'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/postgresql_database_tasks.rb:17:in `create'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:93:in `create'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:107:in `block in create_current'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:275:in `block in each_current_configuration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:274:in `each'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:274:in `each_current_configuration'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/tasks/database_tasks.rb:106:in `create_current'
/var/lib/gems/2.1.0/gems/activerecord-4.2.0/lib/active_record/railties/databases.rake:17:in `block (2 levels) in <top (required)>'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/var/lib/gems/2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/var/lib/gems/2.1.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"app_angular_rails_test"}
It seems that there isn't a role called "giovanni" in my local computer so i tried to create one by log in in the postgresql console and insert the query for create one user:
sudo -u postgress -i
CREATE ROLE giovanni WITH PASSWORD 'password' CREATEDB LOGIN CREATEROLE CREATEUSER SUPERUSER;
but i recive this error:
ERROR: conflicting or redundant options
I tried to rewrite this query in some other ways following the official documentation of the database but it didn't worked
You can try to create a user with createuser program, it has the same functionality as CREATE ROLE (in fact, it calls this command) but can be run from the command shell.
$ createuser giovanni
Shall the new role be a superuser? (y/n) y
Shall the new role be allowed to create databases? (y/n) y
Shall the new role be allowed to create more new roles? (y/n) y
CREATE USER
or with command line options:
$ createuser -P -s -e giovanni
Enter password for new role: xyzzy
Enter it again: xyzzy
CREATE ROLE giovanni PASSWORD 'xyzzy' SUPERUSER CREATEDB CREATEROLE INHERIT LOGIN;
CREATE ROLE
It is because you are using CREATEUSER and CREATEROLE both. Chnage your query to CREATE ROLE test WITH SUPERUSER LOGIN CREATEDB CREATEROLE ENCRYPTED PASSWORD 'password';
This is what i usually do to set up postgres,create DB and its role to be use in database.yml on ubuntu terminal
add-apt-repository ppa:pitti/postgresql
##or use sudo apt-get install postgresql instead of repository
apt-get -y update
apt-get -y install postgresql libpq-dev
sudo -u postgres psql
# \password
# create user blog with password 'secret';
# create database blog_production owner blog;
# \q
use the above role in database.yml
development:
adapter: postgresql
encoding: unicode
database: blog_production
pool: 5
host: localhost
username: blog
password:secret
once its done,you just need to run bundle exec rake db:setup....and you will have all the tables in your db ready.
Cloned new rails project, and tried to run rake db:migrate am getting the following error message.
Backtrace:
rake db:migrate --trace
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment rake aborted! ArgumentError: wrong number of arguments calling `to_sql` (2 for 1)
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/jdbc/adapter.rb:535:in `select'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:16:in `select_all'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/query_cache.rb:63:in `select_all'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:22:in `select_one'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/database_statements.rb:28:in `select_value'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/adapter.rb:73:in `select_version'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/adapter.rb:81:in `redshift?'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/adapter.rb:795:in `client_min_messages='
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/adapter.rb:108:in `configure_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/jdbc/adapter.rb:77:in `initialize'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/adapter.rb:1404:in `initialize'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/jdbc/connection_methods.rb:12:in `jdbc_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-jdbc-adapter-1.3.16/lib/arjdbc/postgresql/connection_methods.rb:45:in `postgresql_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:277:in `new_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:235:in `checkout' org/jruby/RubyKernel.java:1501:in `loop'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `checkout'
home/raj/.rvm/rubies/jruby-1.7.12/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/model_schema.rb:308:in `clear_cache!'
home/raj/.rvm/gems/jruby-1.7.12/gems/activerecord-3.2.0/lib/active_record/railtie.rb:91:in `_callback_before_13'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:421:in `_run__141113183__prepare__2003038971__callbacks'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:405:in `__run_callback'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:390:in `_run_prepare_callbacks'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/callbacks.rb:81:in `run_callbacks'
home/raj/.rvm/gems/jruby-1.7.12/gems/actionpack-3.2.0/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
home/raj/.rvm/gems/jruby-1.7.12/gems/actionpack-3.2.0/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/application/finisher.rb:48:in `Finisher' org/jruby/RubyBasicObject.java:1562:in `instance_exec'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/initializable.rb:30:in `run'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/initializable.rb:55:in `run_initializers' org/jruby/RubyArray.java:1613:in `each'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/initializable.rb:54:in `run_initializers'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/application.rb:136:in `initialize!'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
home/raj/projects/property1view.com/config/environment.rb:5:in `(root)' org/jruby/RubyKernel.java:1065:in `require'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:236:in `load_dependency'
home/raj/.rvm/gems/jruby-1.7.12/gems/activesupport-3.2.0/lib/active_support/dependencies.rb:251:in `require'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/application.rb:1:in `(root)'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/application.rb:103:in `require_environment!' org/jruby/RubyProc.java:271:in `call'
home/raj/.rvm/gems/jruby-1.7.12/gems/railties-3.2.0/lib/rails/application.rb:292:in `initialize_tasks' org/jruby/RubyArray.java:1613:in `each'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:240:in `execute'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:179:in `invoke_with_call_chain'
home/raj/.rvm/rubies/jruby-1.7.12/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain' org/jruby/RubyArray.java:1613:in `each'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:201:in `invoke_prerequisites'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:199:in `invoke_prerequisites'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:178:in `invoke_with_call_chain'
home/raj/.rvm/rubies/jruby-1.7.12/lib/ruby/1.9/monitor.rb:211:in `mon_synchronize'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task' org/jruby/RubyArray.java:1613:in `each'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:106:in `top_level'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:106:in `top_level'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:78:in `run'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/lib/rake/application.rb:75:in `run' org/jruby/RubyKernel.java:1081:in `load'
home/raj/.rvm/gems/jruby-1.7.12/gems/rake-10.4.2/bin/rake:33:in `(root)' org/jruby/RubyKernel.java:1101:in `eval'
home/raj/.rvm/gems/jruby-1.7.12/bin/jruby_executable_hooks:15:in `(root)'
Environment:
jruby-1.7.12
Rails 3.2.0
psql (PostgreSQL) 9.1.15
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu0.14.04.2)
config/environment.rb
# Load the rails application
require File.expand_path('../application', __FILE__)
# Initialize the rails application
MyApplication::Application.initialize!
Simply fixed the issue by updating database related gems, using the bundle update command.
I have just installed postgresql, because I want to put my apps onto heroku. When trying to set up a new rails app using pq, once I rake db:create and I get the following error message, I have no clue what it means, or what to do.
Here's the error message that I'm receiving.
new-host-2:scheduleScraper rickmasta$ rake db:create:all
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `connect'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
/Users/rickmasta/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
/Users/rickmasta/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:144:in `rescue in create_database'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:85:in `create_database'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:52:in `block (5 levels) in <top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:184:in `local_database?'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:52:in `block (4 levels) in <top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:38:in `each_value'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:38:in `block (3 levels) in <top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/Users/rickmasta/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/bin/rake:19:in `load'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/bin/rake:19:in `<main>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"scheduleScraper_development", "pool"=>5, "username"=>"scheduleScraper", "password"=>nil}
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `connect'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
/Users/rickmasta/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
/Users/rickmasta/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:144:in `rescue in create_database'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:85:in `create_database'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:52:in `block (5 levels) in <top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:184:in `local_database?'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:52:in `block (4 levels) in <top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:38:in `each_value'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:38:in `block (3 levels) in <top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/Users/rickmasta/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/bin/rake:19:in `load'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/bin/rake:19:in `<main>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"scheduleScraper_test", "pool"=>5, "username"=>"scheduleScraper", "password"=>nil}
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/pgsql_socket/.s.PGSQL.5432"?
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `connect'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
/Users/rickmasta/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
/Users/rickmasta/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:144:in `rescue in create_database'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:85:in `create_database'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:52:in `block (5 levels) in <top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:184:in `local_database?'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:52:in `block (4 levels) in <top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:38:in `each_value'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/gems/activerecord-3.2.13/lib/active_record/railties/databases.rake:38:in `block (3 levels) in <top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `call'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:246:in `block in execute'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `each'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:241:in `execute'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:184:in `block in invoke_with_call_chain'
/Users/rickmasta/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:177:in `invoke_with_call_chain'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/task.rb:170:in `invoke'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:143:in `invoke_task'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block (2 levels) in top_level'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `each'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:101:in `block in top_level'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:110:in `run_with_threads'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:95:in `top_level'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:73:in `block in run'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:160:in `standard_exception_handling'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/lib/rake/application.rb:70:in `run'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/gems/rake-10.0.4/bin/rake:33:in `<top (required)>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/bin/rake:19:in `load'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392#global/bin/rake:19:in `<main>'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/Users/rickmasta/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "database"=>"scheduleScraper_production", "pool"=>5, "username"=>"scheduleScraper", "password"=>nil}
This is a known issue when installing PostgreSQL with brew on Mountain Lion. Postgres is putting the socket file in a different directory, /var/pgsql_socket_alt, then where psql, createdb, Rails, etc. know where to look for it. You need to change where the socket file goes via the postgres.conf file. See this link on how to fix it.
You may have installed postgres, but is it running?
I got almost identical errors after a reboot of my machine, because I didn't remember to (re)launch the postgres application locally. After I launched the PostGres application again, everything worked without a problem.
These were my errors:
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (fe80::1) and accepting
TCP/IP connections on port 5432?
from /Users/gregorysmith/.rvm/gems/ruby-1.9.3-p429/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
etc, etc. ........