# Error in Bundler with PostgreSQL and Rails3

**URL:** <https://www.ruby-forum.com/t/error-in-bundler-with-postgresql-and-rails3/183104>\
**Category:** Rails\
**Created:** [February 8, 2010, 8:50am UTC](https://www.ruby-forum.com/t/error-in-bundler-with-postgresql-and-rails3/183104 "2010-02-08T08:50:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [February 8, 2010, 8:50am UTC](https://www.ruby-forum.com/t/error-in-bundler-with-postgresql-and-rails3/183104/1 "2010-02-08T08:50:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [February 8, 2010, 3:23pm UTC](https://www.ruby-forum.com/t/error-in-bundler-with-postgresql-and-rails3/183104/2 "2010-02-08T15:23:52Z")

</div>

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](http://localhost:3000/users)

CRUD operations are all working good

Hope this helps…

---

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [February 8, 2010, 3:26pm UTC](https://www.ruby-forum.com/t/error-in-bundler-with-postgresql-and-rails3/183104/3 "2010-02-08T15:26:48Z")

</div>

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 !!!)

---

<div class="post-metadata">

**Author:** ![bluetrust](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/8e7dd6/32.png) [@bluetrust](https://www.ruby-forum.com/u/bluetrust)\
**Post date:** [February 9, 2010, 1:44am UTC](https://www.ruby-forum.com/t/error-in-bundler-with-postgresql-and-rails3/183104/4 "2010-02-09T01:44:13Z")

</div>

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 T. wrote:

> 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](http://localhost:3000/users)
> 
> CRUD operations are all working good
> 
> Hope this helps…
