I can not create PostgreSQL database via prompt with Ruby on Rails - ruby-on-rails

Hello Guys I'm trying to study Ruby On Rails but I can not continue reading a book written by
Brazilian author.
I was going step by step (A, B, C, D, see below) and PROPERLY INSTALLED POSTGRESQL
A) I installed Ruby correctly.
C:\rails>ruby -v
ruby 1.9.3p429 (2013-05-15) [i386-mingw32]
B) I installed Gems correctly.
C:\rails>gem -v
2.1.11
C) I installed all the gems RAILS correctly.
***************************** GEM INSTALADADAS ***********
gem install rubygems-update-1.3.1.gem
gem install rake-0.8.4.gem
gem install activesupport-1.4.4.gem
gem install activesupport-2.3.2.gem
gem install activerecord-1.15.6.gem
gem install activerecord-2.3.2.gem
gem install actionpack-1.13.6.gem REM ***
gem install actionpack-2.3.2.gem
gem install actionmailer-2.3.2.gem
gem install actionwebservice-1.2.6.gem
gem install activeresource-2.3.2.gem
gem install rails-2.3.2.gem
gem install postgres-pr-0.6.1.gem
D) Rails installed correctly.
C:\rails>rails -v
Rails 2.3.2
Getting run the following command
cd projetos
rails --database postgresql projeto01
Template created the perfect site.
When running the command
cd\projetos\projeto01
rake db:create
The following errors have appeared:
ERROR 1
C:\Projetos\projeto01>rake db:create
uninitialized constant PostgresPR::Connection::UNIXSocket
C:/ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependen
cies.rb:105:in `rescue in const_missing'
C:/ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependen
cies.rb:94:in `const_missing'
C:/ruby/lib/ruby/gems/1.9.1/gems/postgres-pr-0.6.1/lib/postgres-pr/connection.rb
:167:in `establish_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/postgres-pr-0.6.1/lib/postgres-pr/connection.rb
:51:in `initialize'
C:/ruby/lib/ruby/gems/1.9.1/gems/postgres-pr-0.6.1/lib/postgres-pr/postgres-comp
at.rb:23:in `new'
C:/ruby/lib/ruby/gems/1.9.1/gems/postgres-pr-0.6.1/lib/postgres-pr/postgres-comp
at.rb:23:in `initialize'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/postgresql_adapter.rb:916:in `new'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/postgresql_adapter.rb:916:in `connect'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/postgresql_adapter.rb:210:in `initialize'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/postgresql_adapter.rb:37:in `new'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:223:in `new_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:188:in `block (2 levels) in checkout'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:184:in `loop'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:184:in `block in checkout'
C:/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:183:in `checkout'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:98:in `connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_specification.rb:115:in `connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/tasks/databases.rake:70:in `res
cue in create_database'
C:/ruby/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/tasks/databases.rake:35:in `cre
ate_database'
C:/ruby/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/tasks/databases.rake:31:in `blo
ck (2 levels) in <top (required)>'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in e
xecute'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in i
nvoke_with_call_chain'
C:/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_wit
h_call_chain'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:149:in `inv
oke_task'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `blo
ck (2 levels) in top_level'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `eac
h'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `blo
ck in top_level'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:115:in `run
_with_threads'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:100:in `top
_level'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:78:in `bloc
k in run'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:165:in `sta
ndard_exception_handling'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
C:/ruby/bin/rake:23:in `load'
C:/ruby/bin/rake:23:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"UTF-8", "dat
abase"=>"projeto01_development", "pool"=>5, "username"=>"exercicio_livro", "pass
word"=>"rails"}
C:\Projetos\projeto01>rake db:create
uninitialized constant PostgresPR::Connection::UNIXSocket
C:/ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependen
cies.rb:105:in `rescue in const_missing'
C:/ruby/lib/ruby/gems/1.9.1/gems/activesupport-2.3.2/lib/active_support/dependen
cies.rb:94:in `const_missing'
C:/ruby/lib/ruby/gems/1.9.1/gems/postgres-pr-0.6.1/lib/postgres-pr/connection.rb
:167:in `establish_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/postgres-pr-0.6.1/lib/postgres-pr/connection.rb
:51:in `initialize'
C:/ruby/lib/ruby/gems/1.9.1/gems/postgres-pr-0.6.1/lib/postgres-pr/postgres-comp
at.rb:23:in `new'
C:/ruby/lib/ruby/gems/1.9.1/gems/postgres-pr-0.6.1/lib/postgres-pr/postgres-comp
at.rb:23:in `initialize'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/postgresql_adapter.rb:916:in `new'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/postgresql_adapter.rb:916:in `connect'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/postgresql_adapter.rb:210:in `initialize'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/postgresql_adapter.rb:37:in `new'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/postgresql_adapter.rb:37:in `postgresql_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:223:in `new_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:245:in `checkout_new_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:188:in `block (2 levels) in checkout'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:184:in `loop'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:184:in `block in checkout'
C:/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:183:in `checkout'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:98:in `connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_pool.rb:326:in `retrieve_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_specification.rb:123:in `retrieve_connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/activerecord-2.3.2/lib/active_record/connection
_adapters/abstract/connection_specification.rb:115:in `connection'
C:/ruby/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/tasks/databases.rake:70:in `res
cue in create_database'
C:/ruby/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/tasks/databases.rake:35:in `cre
ate_database'
C:/ruby/lib/ruby/gems/1.9.1/gems/rails-2.3.2/lib/tasks/databases.rake:31:in `blo
ck (2 levels) in <top (required)>'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `call'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:236:in `block in e
xecute'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `each'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:231:in `execute'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:175:in `block in i
nvoke_with_call_chain'
C:/ruby/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:168:in `invoke_wit
h_call_chain'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/task.rb:161:in `invoke'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:149:in `inv
oke_task'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `blo
ck (2 levels) in top_level'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `eac
h'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:106:in `blo
ck in top_level'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:115:in `run
_with_threads'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:100:in `top
_level'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:78:in `bloc
k in run'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:165:in `sta
ndard_exception_handling'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/lib/rake/application.rb:75:in `run'
C:/ruby/lib/ruby/gems/1.9.1/gems/rake-10.1.1/bin/rake:33:in `<top (required)>'
C:/ruby/bin/rake:23:in `load'
C:/ruby/bin/rake:23:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"UTF-8", "dat
abase"=>"projeto01_development", "pool"=>5, "username"=>"exercicio_livro", "pass
word"=>"rails"}
C:\Projetos\projeto01
ERROR 2
C:\Projetos\projeto01> ruby script/server
C:/ruby/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:55:in `requ
ire': cannot load such file -- script/../config/boot (LoadError)
from C:/ruby/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.r
b:55:in `require'
from script/server:2:in `<main>'

You have postgres-pr gem in your Gemfile, as far as I know it is no longer supported by Rails, use pg gem instead.

Related

rails server command show errors

I am using Rails 3.2.15 and Ruby 2.3.1 on my Ubuntu system. Whenever I am trying to start server, I am getting these errors.
rails server
/var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/values/time_zone.rb:270:
warning: circular argument reference - now
=> Booting WEBrick
=> Rails 3.2.15 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Unsupported version: 2.2.11
For more information, read the documentation:http://pat.github.com/ts/en/advanced_config.html
Exiting
/var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/mysql2-0.3.18/lib/mysql2/client.rb:70:in `connect': Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (13) (Mysql2::Error)
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/mysql2-0.3.18/lib/mysql2/client.rb:70:in `initialize'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
from /usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
from /usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/model_schema.rb:310:in `clear_cache!'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activerecord-3.2.15/lib/active_record/railtie.rb:103:in `block (2 levels) in <class:Railtie>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:418:in `_run__4005937425673360809__prepare__505669176022602409__callbacks'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:405:in `__run_callback'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/actionpack-3.2.15/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/actionpack-3.2.15/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `instance_exec'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/initializable.rb:30:in `run'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/initializable.rb:55:in `block in run_initializers'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `each'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/initializable.rb:54:in `run_initializers'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/application.rb:136:in `initialize!'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /var/www/html/popthefizz.co.uk/releases/20131108040629/config/environment.rb:5:in `<top (required)>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `block in require'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:236:in `load_dependency'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/activesupport-3.2.15/lib/active_support/dependencies.rb:251:in `require'
from /var/www/html/popthefizz.co.uk/releases/20131108040629/config.ru:3:in `block in <main>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /var/www/html/popthefizz.co.uk/releases/20131108040629/config.ru:in `new'
from /var/www/html/popthefizz.co.uk/releases/20131108040629/config.ru:in `<main>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/commands/server.rb:46:in `app'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/commands/server.rb:70:in `start'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/commands.rb:55:in `block in <top (required)>'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/commands.rb:50:in `tap'
from /var/www/vhosts/popthefizz.co.uk/shared/bundle/ruby/2.3.0/gems/railties-3.2.15/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:7:in `require'
from script/rails:7:in `<main>'
Add this to your gem file
gem 'riddle', '1.5.1'
gem 'thinking-sphinx', '2.0.11', :require => "thinking_sphinx"
and run bundle

Rake db:create gives error on server

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.

Spork error in Rails 4

Using RSpec, Rails
Preloading Rails environment
Loading Spork.prefork block...
no implicit conversion of nil into String (TypeError)
no implicit conversion of nil into String (TypeError)
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_adapters/sqlite3_adapter.rb:26:in `initialize'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_adapters/sqlite3_adapter.rb:26:in `new'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_adapters/sqlite3_adapter.rb:26:in `sqlite3_connection'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:440:in `new_connection'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:450:in `checkout_new_connection'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:421:in `acquire_connection'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:356:in `block in checkout'
/Users/me/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:355:in `checkout'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:265:in `block in connection'
/Users/me/.rvm/rubies/ruby-2.1.1/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:264:in `connection'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_adapters/abstract/connection_pool.rb:546:in `retrieve_connection'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_handling.rb:79:in `retrieve_connection'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/connection_handling.rb:53:in `connection'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/migration.rb:796:in `current_version'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/migration.rb:804:in `needs_migration?'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activerecord-4.0.4/lib/active_record/migration.rb:383:in `check_pending!'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/spec/spec_helper.rb:23:in `block in <top (required)>'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/spork-1.0.0rc4/lib/spork.rb:24:in `prefork'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/spec/spec_helper.rb:6:in `<top (required)>'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:223:in `load'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:223:in `block in load'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:214:in `load_dependency'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/activesupport-4.0.4/lib/active_support/dependencies.rb:223:in `load'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/spork-1.0.0rc4/lib/spork/test_framework.rb:138:in `block (2 levels) in preload'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/spork-rails-4.0.0/lib/spork/app_framework/rails.rb:8:in `preload'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/spork-1.0.0rc4/lib/spork/test_framework.rb:134:in `block in preload'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/spork-1.0.0rc4/lib/spork.rb:62:in `exec_prefork'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/spork-1.0.0rc4/lib/spork/test_framework.rb:120:in `preload'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/spork-1.0.0rc4/lib/spork/run_strategy/forking.rb:25:in `preload'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/spork-1.0.0rc4/lib/spork/runner.rb:75:in `run'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/spork-1.0.0rc4/lib/spork/runner.rb:10:in `run'
/Users/me/Desktop/rails_stuff/rails_projects/sample_app/vendor/bundle/gems/spork-1.0.0rc4/bin/spork:10:in `<top (required)>'
/Users/me/.rvm/gems/ruby-2.1.1/bin/spork:23:in `load'
/Users/me/.rvm/gems/ruby-2.1.1/bin/spork:23:in `<main>'
/Users/me/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `eval'
/Users/me/.rvm/gems/ruby-2.1.1/bin/ruby_executable_hooks:15:in `<main>'
Figured it out... corrupt bundle. I needed to rebuild my bundle after upgrading from Mac OS 10.8 to 10.9. I deleted my vendor\bundle directory and ran bundle install.

postgres error for rails in ubuntu

I was having a rails application, and I want to deploy it in my new laptop ( with ruby and rails installed fresh).
After installing gems and all .. when i goto my rails application folder and ruby rails s
Error shows like :
/home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `initialize': FATAL: role "insane" does not exist (PG::Error)
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `new'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:1208:in `connect'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:326:in `initialize'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
from /home/insane/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
from /home/insane/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/model_schema.rb:308:in `clear_cache!'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activerecord-3.2.11/lib/active_record/railtie.rb:97:in `block (2 levels) in <class:Railtie>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:418:in `_run__2015430698042624034__prepare__3529665547423141566__callbacks'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:405:in `__run_callback'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/actionpack-3.2.11/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `instance_exec'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/initializable.rb:30:in `run'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/initializable.rb:55:in `block in run_initializers'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `each'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/initializable.rb:54:in `run_initializers'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/application.rb:136:in `initialize!'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /home/insane/Rails/BACKUP/config/environment.rb:5:in `<top (required)>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `block in require'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:236:in `load_dependency'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/activesupport-3.2.11/lib/active_support/dependencies.rb:251:in `require'
from /home/insane/Rails/BACKUP/config.ru:3:in `block in <main>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /home/insane/Rails/BACKUP/config.ru:in `new'
from /home/insane/Rails/BACKUP/config.ru:in `<main>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/commands/server.rb:46:in `app'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/commands/server.rb:70:in `start'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/commands.rb:55:in `block in <top (required)>'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
from /home/insane/.rvm/gems/ruby-2.1.0/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I have gone through the below link , but even it dint help saying /Rails/BACKUP$ createdb insane
createdb: could not connect to database postgres: FATAL: role "insane" does not exist
(postgreSQL error) FATAL: role "demo" does not exist (PG::Error)`
Please help
You need a user in the database named insane.
Open up a terminal and do the following
(the $ and psql> denote the terminal type, not commands that you type)
$ psql template1
psql> CREATE USER insane WITH PASSWORD 'some_password';
That should create the user for you. Alternatively, if this is on a dev machine, you can just use
psql> CREATE USER insane superuser;
That will create the user insane with all permissions.
NOTE
You may first need to be logged in as the postgres user.
$ sudo su postgres
<password for your account>
You will not see your password being typed.
Then you will be able to use the first set of commands above.

(postgreSQL error) FATAL: role "demo" does not exist (PG::Error)

So I've just installed postgreSQL with HomeBrew and have initialized my new demo_app with the: rails new demo_app -d postgresql command.
Albeit, I am getting the following error when starting up the server rails s.
Snippit:
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize': FATAL: role "demo" does not exist (PG::Error)
Full log:
/usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize': FATAL: role "demo" does not exist (PG::Error)
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `new'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `connect'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:324:in `initialize'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `new'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/postgresql_adapter.rb:28:in `postgresql_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:315:in `new_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:325:in `checkout_new_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:247:in `block (2 levels) in checkout'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `loop'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:242:in `block in checkout'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:239:in `checkout'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:102:in `block in connection'
from /usr/local/rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:101:in `connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:410:in `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:171:in `retrieve_connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_specification.rb:145:in `connection'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/activerecord-3.2.13/lib/active_record/railtie.rb:88:in `block in <class:Railtie>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/initializable.rb:30:in `run'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `each'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/application.rb:136:in `initialize!'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/anthonypanepinto/Sites/new_demo/demo/config/environment.rb:5:in `<top (required)>'
from /Users/anthonypanepinto/Sites/new_demo/demo/config.ru:3:in `require'
from /Users/anthonypanepinto/Sites/new_demo/demo/config.ru:3:in `block in <main>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /Users/anthonypanepinto/Sites/new_demo/demo/config.ru:in `new'
from /Users/anthonypanepinto/Sites/new_demo/demo/config.ru:in `<main>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/builder.rb:40:in `eval'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/builder.rb:40:in `parse_file'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/server.rb:200:in `app'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/commands/server.rb:46:in `app'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/server.rb:304:in `wrapped_app'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/rack-1.4.5/lib/rack/server.rb:254:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/commands/server.rb:70:in `start'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/commands.rb:55:in `block in <top (required)>'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /usr/local/rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.13/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
When your create rails app, you must create a database with postgres for that it works.
createdb demo
And check your config/database.yml

Resources