0

I finally got the gem pg to install. Now when I go to migrate the database I get the following:

$ rake db:migrate
(in c:/rubyDev/bsbaslic)
rake aborted!
no such file to load -- 1.9/pg_ext
c:/Ruby192/lib/ruby/gems/1.9.1/gems/pg-0.10.0/lib/pg.rb:10:in `require'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/pg-0.10.0/lib/pg.rb:10:in `<top (required)>'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `require'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:64:in `block (2 levels) in require'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `each'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:62:in `block in require'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `each'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler/runtime.rb:51:in `require'
c:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.3/lib/bundler.rb:112:in `require'
c:/rubyDev/bsbaslic/config/application.rb:7:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
c:/rubyDev/bsbaslic/Rakefile:4:in `<top (required)>'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2373:in `load'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
c:/Ruby192/lib/ruby/1.9.1/rake.rb:1991:in `run'
c:/Ruby192/bin/rake:31:in `<main>'

Does anybody have any ideas as to what it is looking for? I have a pg_ext.so file in the same directory as pg.rb.

1
  • What version of the Postgres gem (pg) are you running? Commented Mar 25, 2011 at 15:38

2 Answers 2

1

Windows programs cannot load .so files - they load .dll files instead. You need a build of pg compiled for Windows, or you need to be running Ruby from within a Linuxy environment such as msys or cygwin.

Sign up to request clarification or add additional context in comments.

2 Comments

I am running from msys. I could not get "gem install pg" to work within the regular command prompt. Any other ideas?
When you run "gem install" what specifically happens? Please add that to your question.
1

The problem is in your version of pg gem. There is a special version for windows pg 0.9.0. In order to have it workingon windows:

  1. uninstall the current pg 0.10.0
  2. install pg as follows: gem install pg --version=0.9.0 -- --with-pg-config=/short/path/to/postresql/bin (To get short path you can simply change directory to PostgrSQL bin and then type command in cmd, it will automaticaly change path to a short verison)

  3. Then edit your project Gemfile in order to use correct pg gem version (0.9.0)

And that's it.

Good Luck

1 Comment

10 months on, should later versions now work? I need pg and activerecord-postgis-adapter. activerecord-postgis-adapter seems to require at least 0.10.0.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.