Estou tentando criar uma nova aplicação utilizando banco de dados postgres em um ambiente windows.
Criei o projeto utilizando o comando rails new blog -d postgresql
Quando estou executando o comando rake db:create o seguinte erro acontece:
Please install the postgresql adapter: gem install activerecord-postgresql-adap ter
(pg is not part of the bundle. Add it to Gemfile.)
No entando, a gem pg está no meu GemFile.
Ao executar o comando bundle install a gem pg não aparece na lista.
Não sei mais que fazer, já faz 3 dias que estou travado neste erro.
Segue abaixo o erro completo
Invoke db:create (first_time)
Invoke db:load_config (first_time)
Execute db:load_config
Invoke rails_env (first_time)
Execute rails_env
Execute db:create
rake aborted!
Please install the postgresql adapter: gem install activerecord-postgresql-adap ter
(pg is not part of the bundle. Add it to Gemfile.)
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/rubygems_integ
ration.rb:214:in block in replace_gem? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/active_record/co nnection_adapters/postgresql_adapter.rb:7:in
<top (required)>?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/
dependencies.rb:251:in require? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/ dependencies.rb:251:in
block in require?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/
dependencies.rb:236:in load_dependency? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activesupport-3.2.13/lib/active_support/ dependencies.rb:251:in
require?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/active_record/co
nnection_adapters/abstract/connection_specification.rb:50:in resolve_hash_conne ction? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/active_record/co nnection_adapters/abstract/connection_specification.rb:29:in
spec?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/active_record/co
nnection_adapters/abstract/connection_specification.rb:130:in establish_connect ion? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/active_record/ra ilties/databases.rake:101:in
create_database?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/active_record/ra
ilties/databases.rake:62:in block (3 levels) in <top (required)>? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/active_record/ra ilties/databases.rake:62:in
each?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/activerecord-3.2.13/lib/active_record/ra
ilties/databases.rake:62:in block (2 levels) in <top (required)>? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:246:in
cal
l?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:246:in blo ck in execute? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:241:in
eac
h?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:241:in exe cute? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:184:in
blo
ck in invoke_with_call_chain?
C:/Ruby200-x64/lib/ruby/2.0.0/monitor.rb:211:in mon_synchronize? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:177:in
inv
oke_with_call_chain?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:170:in inv oke? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:143: in
invoke_task?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:
in block (2 levels) in top_level? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101: in
each?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:101:
in block in top_level? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:110: in
run_with_threads?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:95:i
n top_level? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:73:i n
block in run?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:160:
in standard_exception_handling? C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/application.rb:70:i n
run?
C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/rake-10.0.4/bin/rake:33:in <top (requir ed)>? C:/Ruby200-x64/bin/rake:23:in
load?
C:/Ruby200-x64/bin/rake:23:in `
?
Tasks: TOP => db:create