datamapper / do

DataObjects
147 stars 74 forks source link

Strange LoadError on Windows #51

Open revskill10 opened 11 years ago

revskill10 commented 11 years ago

Hi, i'm using DataMapper with Postgresql on Windows XP for development. Ruby 1.9.3 with RubyInstaller. The setup is normal, there is no error in loading gems. But when i run the same setup on Windows Server 2008 machine, do_postgres can't be loaded. The error is here:

E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/do_postgres-0.10.12-x86-mingw32/lib/d
o_postgres.rb:31:in `require': 126: The specified module could not be found.   -
 E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/do_postgres-0.10.12-x86-mingw32/lib/
do_postgres/1.9/do_postgres.so (LoadError)
        from E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/do_postgres-0.10.12-x86-
mingw32/lib/do_postgres.rb:31:in `rescue in <top (required)>'
        from E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/do_postgres-0.10.12-x86-
mingw32/lib/do_postgres.rb:26:in `<top (required)>'
        from E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/dm-postgres-adapter-1.2.
0/lib/dm-postgres-adapter/adapter.rb:1:in `require'
        from E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/dm-postgres-adapter-1.2.
0/lib/dm-postgres-adapter/adapter.rb:1:in `<top (required)>'
        from E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/dm-postgres-adapter-1.2.
0/lib/dm-postgres-adapter.rb:1:in `require'
        from E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/dm-postgres-adapter-1.2.
0/lib/dm-postgres-adapter.rb:1:in `<top (required)>'
        from E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0/lib/dm-cor
e/adapters.rb:163:in `require'
        from E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0/lib/dm-cor
e/adapters.rb:163:in `load_adapter'
        from E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0/lib/dm-cor
e/adapters.rb:133:in `adapter_class'
        from E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0/lib/dm-cor
e/adapters.rb:13:in `new'
        from E:/dungth/Ruby193/lib/ruby/gems/1.9.1/gems/dm-core-1.2.0/lib/dm-cor
e.rb:230:in `setup'

Do you know why is this error and how to fix it ? Thank you very much.

dbussink commented 11 years ago

Haven't seen this error before, but have you also installed the postgres dll files? After installing the gem it should print instructions on how to do this.

lgulliver commented 11 years ago

I get this on Windows 8 as well, with the same error.

I have the postgres DLLs all in the right places, but the error is still present even with it setup in the PATH.

xpentor commented 11 years ago

I have this error as well in Windows 7 and I have all DLLs in the right places. frustrating!

dbussink commented 11 years ago

Biggest problem here is that I don't have access to any Windows machine to check this issue.

Googling for similar issues does seem to point at DLL loading issues with other native libraries:

http://stackoverflow.com/questions/5164818/loaderror-trying-to-use-mysql-with-ruby-on-rails-in-windows-rubymine-ide