Error in Bundler with PostgreSQL and Rails3

Hi there,

I'm trying to get up and running with PostgreSQL 8.4 and the Rails 3 beta. I'm running on Ruby 1.8.7 via RVM and have installed the 'pg' gem. While I've been able to get the pg gem to successfully build, whenever I create a new rails app, tell it to use Postgres, and execute 'rails server' I get the following error:

jury$ rails server /Users/jury/.rvm/gems/ruby-1.8.7-p249/gems/pg-0.8.0/lib/pg.bundle: dlsym(0x1026ef640, Init_pg): symbol not found - /Users/jury/.rvm/gems/ruby-1.8.7-p249/gems/pg-0.8.0/lib/pg.bundle (LoadError)   from /Users/jury/.rvm/gems/ruby-1.8.7-p249/gems/bundler-0.9.3/lib/bundler/runtime.rb:26:in `require'   from /Users/jury/.rvm/gems/ruby-1.8.7-p249/gems/bundler-0.9.3/lib/bundler/runtime.rb:25:in `each'   from /Users/jury/.rvm/gems/ruby-1.8.7-p249/gems/bundler-0.9.3/lib/bundler/runtime.rb:25:in `require'   from /Users/jury/.rvm/gems/ruby-1.8.7-p249/gems/bundler-0.9.3/lib/bundler/runtime.rb:24:in `each'   from /Users/jury/.rvm/gems/ruby-1.8.7-p249/gems/bundler-0.9.3/lib/bundler/runtime.rb:24:in `require'   from /Users/jury/.rvm/gems/ruby-1.8.7-p249/gems/bundler-0.9.3/lib/bundler.rb:70:in `require'   from /Volumes/Khronos/jury/Documents/rails3/postApp/config/application.rb:6   from /Users/jury/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta/lib/rails/commands.rb:36:in `require'   from /Users/jury/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta/lib/rails/commands.rb:36   from /Volumes/Khronos/jury/Documents/rails3/postApp/script/rails:10:in `require'   from /Volumes/Khronos/jury/Documents/rails3/postApp/script/rails:10

I'm guessing this is either an error in bundler or ruby-pg, but would appreciate any pointers if anyone has run into this before and worked around it.

For that matter, has anyone out there successfully got the Rails 3 beta and Postgres working well together? If so, I'd love to know what you've done.

Thanks in advance!

-J

I just try and all are working good under Ruby 1.8.7 MRI... (I did'nt try RVM...)

I did'nt any special thing, I just install pg gem and run:

rails xxx -d postgresql cd xxx I have modify config/database.yml adding => host: localhost and setting user / password rails generate scaffold user name:string published:boolean rake db:create rake db:migrate rails server

=> http://localhost:3000/users

CRUD operations are all working good

Hope this helps...

Wait a moment...

Do you have removed the old versions of bundler gem ? (I think that is very important to have only the last version installed !!!)

So looks like this is an issue with the PostgreSQL install that I happened to snag. I just finished blowing everything away and reinstalling it all from MacPorts and it's working like a charm.

Huge thanks for your hep, Gianluca!

-J

Gianluca Tessarolo wrote: