Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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>'
share|improve this question
1  
I would recommend getting a newer book, you should be working with Rails4 (not Rails2) if you're just starting. –  mu is too short 13 hours ago
add comment

1 Answer

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

share|improve this answer
 
as well as install the correct gem ? In the book I'm reading tells just install postgres-pr-0.6.1.gem What's for RAILS 2.3.2 –  user3163759 14 hours ago
 
Replace postgres-pr with pg in your gemfile, run Bundle and you should be fine. Rails 2.3.2? This must be a really old book, it's bit outdated now. –  zrl3dx 14 hours ago
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.