yesterday i installed a fresh rails installation with a proper upgrade
of gem to version 1.0.1
i saw, there is still a gem package to support postgresql known as
postgres-0.7.9.2008.01.09
on rubyforge, its the newest one of stable postgres support for ruby
additionally i installed, of course, a the postgres database on my
machine to
C:\Programme\PostgreSQL\8.2
after setting up a new rails project and editing the database.yml
i execute the command rake db:create:all to create all databases on
the fly
and the prompt shows me:
the database.yml is okay
i set the adapter to postgresql for each database
im working under win xp, can it be that postgres
doesnt work under xp well?
i read about it and installed postgres-pr
but the rake task to create the databases also
doesnt work for me.
I get
/usr/local/lib/ruby/1.8/irb/init.rb:252:in `require': no such file to
load -- postgres (LoadError)
from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `each'
from /usr/local/lib/ruby/1.8/irb/init.rb:250:in `load_modules'
from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'
from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'
from /usr/local/bin/irb:13
I have the same problems under Mac OS X Leopard. I am using ruby
1.9.2p180, Rails 3.0.5, rake 0.8.7 and gem 1.5.9. I installed
postgres-pr, but after a rake db:migrate I got this message:
rake aborted!
no such file to load -- pg
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in
`require'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in
`block in require'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in
`block in load_dependency'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:596:in
`new_constants_in'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:225:in
`load_dependency'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/dependencies.rb:239:in
`require'
And this command here
rake rails:update
does not solve my problem. I am still unable to execute rake db:migrate.
But the command
rails dbconsole just fires up the database's native command line tool,
using database.yml to pull out the host and so on, so it will worked
even if the gem used for that database is missing etc.
The gem used for postgres these days is called pg - make sure that is
in your Gemfile (and of course run bundle install after modifying your
Gemfile)