Reputation: 41
I have two rails applications, "old" one and new one, created with
$ rails new blog -d postgresql
when i try to start the server, it works on "old" application without problems:
$ rails s -p 2000
=> Booting WEBrick
=> Rails 3.2.8 application starting in development on http://0.0.0.0:2000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-09-17 16:28:48] INFO WEBrick 1.3.1
[2012-09-17 16:28:48] INFO ruby 1.9.3 (2012-04-20) [x86_64-linux]
[2012-09-17 16:28:48] INFO WEBrick::HTTPServer#start: pid=9377 port=2000
but it fails for "new" application :/
$ rails s -p 2000
/usr/local/share/gems/gems/pg-0.14.1/lib/pg.rb:4:in `require': cannot load such file -- pg_ext (LoadError)
from /usr/local/share/gems/gems/pg-0.14.1/lib/pg.rb:4:in `<top (required)>'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `require'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `each'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:66:in `block in require'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `each'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler/runtime.rb:55:in `require'
from /usr/local/share/gems/gems/bundler-1.1.5/lib/bundler.rb:119:in `require'
from /home/alex/tmp/RoR/blog/config/application.rb:7:in `<top (required)>'
from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
from /usr/local/share/gems/gems/railties-3.2.8/lib/rails/commands.rb:50:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
it's possible to fix if i copy or symlink pg_ext.so to module path:
# ln -s /usr/local/share/gems/gems/pg-0.14.1/ext/pg_ext.so /usr/local/share/gems/gems/pg-0.14.1/lib
or i can directly add requirement to boot.rb:
require 'rubygems'
require 'pg'
But it's not acceptable solution and i'm wondering why it works for first application and why it doesn't work for new one ? I've spent all day comparing config files but had no success.
Upvotes: 2
Views: 457
Reputation: 11
I had the same problem after upgrading to Fedora 18.
pg_ext is built when running gem update.
A pre-requisite for that is that postgresql-devel is installed.
Upvotes: 1