$ rake db:create rake aborted! cannot load such file -- mysql2 - ruby-on-rails

I am using postgres on a rails app after switching the working app from sqlite to postgres. When I run rake I get the error cannot load such file -- mysql2. I have never used mysql for this app. Any ideas?
EDIT:
My gemfile does not include mysql and the database adapter is postgresql
This is the stack trace:
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thinking-sphinx-3.0.1/lib/thinking_sphinx.rb:5:in `require'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thinking-sphinx-3.0.1/lib/thinking_sphinx.rb:5:in `<top (required)>'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thinking-sphinx-3.0.1/lib/thinking-sphinx.rb:1:in `require'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thinking-sphinx-3.0.1/lib/thinking-sphinx.rb:1:in `<top (required)>'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `require'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `each'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:66:in `block in require'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `each'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler/runtime.rb:55:in `require'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/bundler-1.0.22/lib/bundler.rb:122:in `require'
C:/Users/Rotimi/My Documents/Aptana Studio 3 Workspace/Book_Search/book_search/config/application.rb:13:in `<top (required)>'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
C:/Users/Rotimi/My Documents/Aptana Studio 3 Workspace/Book_Search/book_search/Rakefile:5:in `<top (required)>'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/rake_module.rb:25:in `load_rakefile'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:583:in `raw_load_rakefile'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:89:in `block in load_rakefile'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:88:in `load_rakefile'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:72:in `block in run'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:160:in `standard_exception_handling'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.3/lib/rake/application.rb:70:in `run'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rake-10.0.3/bin/rake:33:in `<top (required)>'
c:/RailsInstaller/Ruby1.9.3/bin/rake:19:in `load'
c:/RailsInstaller/Ruby1.9.3/bin/rake:19:in `<main>'

I think your issue is with thinking-sphinx. I assume you've built it with the following options:
./configure --prefix=/usr/local --with-pgsql --without-mysql
Also, note that mysql2 is a requirement for thinking-sphinx. See here:
https://github.com/pat/thinking-sphinx
in particular under installation:
It’s a gem, so install it like you would any other gem. You will also
need to specify the Mysql2 gem as well (this is not an inbuilt
dependency because JRuby, when supported, will need something
different):
gem 'mysql2', '0.3.12b4' gem 'thinking-sphinx', '3.0.0' The
mysql2 gem is required for connecting to Sphinx, so please include it
even when you’re using PostgreSQL for your database.

Remove mysql2 from Gemfile. Try to get a full stack trace so you can see who is requiring mysql2. Post the stack trace here. Specify postgres as your adapter in database.yml.

Remove the gem mysql2 from your gemfile if your using bundler or from environments.rb

Remember to include gem 'mysql2' BEFORE 'flying-sphinx' and 'thinking-sphinx' gems

Related

ruby app is giving problems with incompatible libraries

while generating controllers, I am getting this error message:
Leticias-MacBook-Pro:portfolio Tish$ rails g controller welcome index about music loops projects
/Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `require': incompatible library version - /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3/sqlite3_native.bundle (fatal)
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:6:in `rescue in <top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/sqlite3-1.3.12/lib/sqlite3.rb:2:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:86:in `block in require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `each'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler/runtime.rb:75:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/bundler-1.13.6/lib/bundler.rb:106:in `require'
from /Users/Tish/Projects/portfolio/config/application.rb:7:in `<top (required)>'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `require'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:82:in `preload'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:143:in `serve'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:131:in `block in run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `loop'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application.rb:125:in `run'
from /Users/Tish/.rvm/gems/ruby-2.3.1/gems/spring-2.0.0/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Nothing I have tried makes it stop. I have reinstalled every gem it complains about, but the changes do not persist. I've followed every fix I can find/understand but I am chasing my tail on this one.
Working on OSX...
Your rails is not linked with the right ruby version. Use the following code:
rvm use ruby-<version number> like: (rvm use ruby-2.1.4)
then reinstall the bundler:
gem uninstall bundler
gem install bundler
bundle install once again with the new version.
bundle install
Then proceed with your rails g command.

uninitialized constant Mysql2::Client::REMEMBER_OPTIONS

I just meet one uninitialized constanterror,I have no idea on it now.Please save my day.
I'm trying to use mongodb & mysql2 simultaneously.Mongodb was OK.Now I want to add mysql2 gem into my project.
After
gem install mysql2 -- --srcdir=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config and add mysql2 into Gemfile.
When I restart server,it gives me this error:
/usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:12:in `<class:Client>': uninitialized constant Mysql2::Client::REMEMBER_OPTIONS (NameError)
from /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:2:in `<module:Mysql2>'
from /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2/client.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2.rb:10:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11/lib/mysql2.rb:10:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:66:in `block in require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler/runtime.rb:55:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.0.18/lib/bundler.rb:120:in `require'
from /Users/Liber/ktv/trunk/config/application.rb:11:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:53:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:53:in `block in <top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/railties-3.2.8/lib/rails/commands.rb:50:in `tap'
from /usr/local/lib/ruby/gems/1.9.1/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>'
how Can i fix this guy? thank you.
<class:Client>': uninitialized constant Mysql2::Client::REMEMBER_OPTIONS (NameError)
---------------------------Solution----------------------------
Just
brew install mysql
DO NOT use DMG file to install mysql
and then :
sudo gem install mysql2 --with-mysql-config=/usr/local/mysql/bin/mysql_config
Everything is OK now.
Thanks #BenjaminTan
You should check out this link, which outlines nicely how to setup MySQL on Mountain Lion. The main takeway is to rely on brew install rather than the dmg file, as the OP has mentioned.

rspec-rails 2.11.1 + rails 3.2.6

I'm using rspec-rails 2.11.0 in my app, but when I execute rspec spec/ something wrong happens. This is stack of error:
/Users/diego/.rvm/gems/ruby-1.9.3-head#global/gems/bundler-1.1.4/lib/bundler/runtime.rb:31:in `block in setup': You have already activated rspec-core 2.10.1, but your Gemfile requires rspec-core 2.11.1. Using bundle exec may solve this. (Gem::LoadError)
from /Users/diego/.rvm/gems/ruby-1.9.3-head#global/gems/bundler-1.1.4/lib/bundler/runtime.rb:17:in `setup'
from /Users/diego/.rvm/gems/ruby-1.9.3-head#global/gems/bundler-1.1.4/lib/bundler.rb:107:in `setup'
from /Users/diego/.rvm/gems/ruby-1.9.3-head#global/gems/bundler-1.1.4/lib/bundler/setup.rb:7:in `<top (required)>'
from /Users/diego/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
from /Users/diego/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
from /Users/diego/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/diego/Development/Rails/carros/carros-web/config/boot.rb:6:in `<top (required)>'
from /Users/diego/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/diego/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/diego/Development/Rails/carros/carros-web/config/application.rb:1:in `<top (required)>'
from /Users/diego/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/diego/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/diego/Development/Rails/carros/carros-web/config/environment.rb:2:in `<top (required)>'
from /Users/diego/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/diego/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/diego/Development/Rails/carros/carros-web/spec/spec_helper.rb:3:in `<top (required)>'
from /Users/diego/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/diego/.rvm/rubies/ruby-1.9.3-head/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/diego/Development/Rails/carros/carros-web/spec/models/admin_spec.rb:1:in `<top (required)>'
from /Users/diego/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load'
from /Users/diego/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `block in load_spec_files'
from /Users/diego/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `map'
from /Users/diego/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.10.1/lib/rspec/core/configuration.rb:746:in `load_spec_files'
from /Users/diego/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.10.1/lib/rspec/core/command_line.rb:22:in `run'
from /Users/diego/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:69:in `run'
from /Users/diego/.rvm/gems/ruby-1.9.3-head/gems/rspec-core-2.10.1/lib/rspec/core/runner.rb:10:in `block in autorun'
What's is wrong? This is my gem file https://gist.github.com/3280825
What's happening is that your rspec app version is different from the one you have in global env.
And it seems when you execute rspec the one from global is being used.
The way to make it work is to use bundle exec as said from #prusswan wich will execute that command with the app env (with proper gems versions etc..)
Also the error message mentions to try bundle exec
Since bundler is used, although the error message says to "try" bundle exec, you really have to run it with bundle exec if you want to ensure that only the gem versions specified in Gemfile/Gemfile.lock are used. The other alternative would be to use binstubs as explained here.

Ruby on Rails: rb_class_superclass not located in msvcrt-ruby191.dll (ruby-prof error?)

So, long story short, I had o format and reinstall my OS hence all my dev utilities.
git env sorted.
DevKit was fine.
Sphinx/mysql fine.
Bundle installed perfectly.
Everything is gravy until I go to rake db:create and build my database.
Environment:
OS: Win7 64-bit
Ruby192
gem -v 1.8.24
rails 3.1.3
Now the problem, when I rake anything I get a pop-up window
ruby.exe - Entry Point Not Found
The procedure entry point rb_class_superclass could not be located in the dynamic link library msvcrt-ruby191.dll
I've tried clean installing ruby, clearing the gems and reinstalling. Stuck on what to do next.
trace output:
rake aborted!
no such file to load -- ruby/prof
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:74:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:74:in `rescue in block in require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:62:in `block in require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.1.4/lib/bundler.rb:119:in `require'
E:/Documents/Websites/rails-app /trunk/config/application.rb:7:in `<top (required)>'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
E:/Documents/Websites/rails-app/trunk/Rakefile:4:in `<top (required)>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/rake_module.rb:25:in `load_rakefile'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:501:in `raw_load_rakefile'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:82:in `block in load_rakefile'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:81:in `load_rakefile'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:65:in `block in run'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
C:/Ruby192/bin/rake:23:in `load'
C:/Ruby192/bin/rake:23:in `<main>'
I've seen similar issues raised but for different lines in the dll and relating to sqlite3. I'm not using sqlite3 at all though. I'm on mysql with the mysql2 connector.
Any help?
I think I figured this out.
In the gemfile I replaced:
gem "ruby-prof"
with:
gem "ruby-prof", "0.10.8"
and all of a sudden I was rolling onto the next issue, which was specifying my rake version. I think both issues are related to an incompatability between the gems and my rubygems verson (I'm guessing??). This is the only difference I could see between my laptop environment, my desktop environment and my production server.
Either way. Sorted!

rake db:migrate postgreSQL

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.
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.
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:
uninstall the current pg 0.10.0
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)
Then edit your project Gemfile in order to use correct pg gem version (0.9.0)
And that's it.
Good Luck

Resources