Incorrect MySQL client library version! This gem was compiled for 5.5.15 but the client library is 5.0.51b.

4,978 views
Skip to first unread message

rajiv74

unread,
Oct 24, 2011, 11:54:54 PM10/24/11
to RubyInstaller
Hi

I am getting this error on windows machine. I am using a window vista.
I could not get success for making connection with mysql.
I am getting the same error with all almost all versions of rails.
Sometimes I am getting error "This gem was compiled for 6.0.x but the
client library is 5.0.51b." Some times "This gem was compiled for
5.5.15 but the client library is 5.0.51b." Please help to fix this
issue for my window machine(Window Vista).

Below is my Gem list:

*** LOCAL GEMS ***

abstract (1.0.0)
actionmailer (3.1.1, 3.0.5)
actionpack (3.1.1, 3.0.5)
activemodel (3.1.1, 3.0.5)
activerecord (3.1.1, 3.0.5)
activeresource (3.1.1, 3.0.5)
activesupport (3.1.1, 3.0.5)
ansi (1.3.0)
arel (2.2.1, 2.0.10)
builder (3.0.0, 2.1.2)
bundler (1.0.21)
coffee-rails (3.1.1)
coffee-script (2.2.0)
coffee-script-source (1.1.2)
erubis (2.7.0, 2.6.6)
execjs (1.2.9)
hike (1.2.1)
i18n (0.6.0)
jquery-rails (1.0.16)
json (1.6.1)
mail (2.3.0, 2.2.19)
mime-types (1.17.1)
minitest (1.6.0)
multi_json (1.0.3)
mysql2 (0.3.7)
polyglot (0.3.2)
rack (1.3.5, 1.2.4)
rack-cache (1.1)
rack-mount (0.8.3, 0.6.14)
rack-ssl (1.3.2)
rack-test (0.6.1, 0.5.7)
rails (3.1.1, 3.0.5)
railties (3.1.1, 3.0.5)
rake (0.9.2.2, 0.8.7)
rdoc (3.11, 2.5.8)
sass (3.1.10)
sass-rails (3.1.4)
sprockets (2.0.3)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
turn (0.8.3)
tzinfo (0.3.30)
uglifier (1.0.4)
===============================
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.5.2
- RUBY VERSION: 1.9.2 (2011-02-18 patchlevel 180) [i386-mingw32
- INSTALLATION DIRECTORY: C:/Ruby192/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: C:/Ruby192/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/Ruby192/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/Ruby192/lib/ruby/gems/1.9.1
- C:/Users/dell/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.rubyforge.org/", "http://gems.gip://
gems.github.com", "http://gems.github.com", "http://gems.gith//
rubygems.org", "http://rubygems.org", "http://rubygems.org", "horg",
"http://rubygems.org", "http://rubygems.org", "http://gems.ttp://
gems.github.com", "http://gems.rubyforge.org/yaml", "http:/ "http://
gems.github.com","http://gems.rubyforge.org/yaml"]
- "update" => "--env-shebang"
- "install" => "--env-shebang"
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- http://gems.github.com
- http://gems.github.com
- http://gems.github.com
- http://gems.github.com
- http://rubygems.org
- http://rubygems.org
- http://rubygems.org
- http://rubygems.org
- http://rubygems.org
- http://rubygems.org
- http://gems.github.com
- http://gems.github.com
- http://gems.rubyforge.org/yaml
- http://rubygems.org
- http://gems.github.com
- http://gems.rubyforge.org/yaml

Boško Ivanišević

unread,
Oct 25, 2011, 2:11:50 AM10/25/11
to rubyin...@googlegroups.com
On Tue, Oct 25, 2011 at 5:54 AM, rajiv74 <kalya...@gmail.com> wrote:
Hi

I am getting this error on windows machine. I am using a window vista.
I could not get success for making connection with mysql.
I am getting the same error with all almost all versions of rails.
Sometimes I am getting error "This gem was compiled for 6.0.x but the
client library is 5.0.51b." Some times "This gem was compiled for
5.5.15 but the client library is 5.0.51b." Please help to fix this
issue for my window machine(Window Vista).

In which cases you get each of these errors? How do you try to connect to mysql? What is the version of libmysql.dll on your system?
 

--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.




--
Regards,
Boško Ivanišević

Rajiv Kaushal

unread,
Oct 25, 2011, 2:22:23 AM10/25/11
to rubyin...@googlegroups.com
Hi Ivanišević,

I am getting this error when I am running rake db:create or rake db:migrate (in both cases). I have installed mysql gem on my machine by the following command.

         gem install mysql2 -- '--with-mysql-lib="C:\xampp\mysql\lib" --with-mysql-include="C:\xampp\mysql\include"' --no-ri --no-rdoc

I am using the mysql version of xampp server. Below is the configuration of mysql server

MySQL

  • Server: localhost via TCP/IP
  • Server Version: 5.5.16
  • Protokoll-Version: 10
  • Benutzer: root@localhost
  • MySQL-Zeichensatz: UTF-8 Unicode (utf8)

Webserver

  • Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
  • MySQL-Client-Version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $
  • PHP Erweiterung: mysql 
How can I know the version of mysql.dll? (I don't know steps to know libmysql.dll version)

Thanks and Regards,

Rajiv Kaushal

2011/10/25 Boško Ivanišević <bosko.iv...@gmail.com>



--
Thanks and Regards,

Rajiv Kaushal


Boško Ivanišević

unread,
Oct 25, 2011, 2:36:02 AM10/25/11
to rubyin...@googlegroups.com
On Tue, Oct 25, 2011 at 8:22 AM, Rajiv Kaushal <kalya...@gmail.com> wrote:
Hi Ivanišević,

I am getting this error when I am running rake db:create or rake db:migrate (in both cases). I have installed mysql gem on my machine by the following command.

         gem install mysql2 -- '--with-mysql-lib="C:\xampp\mysql\lib" --with-mysql-include="C:\xampp\mysql\include"' --no-ri --no-rdoc

I am using the mysql version of xampp server. Below is the configuration of mysql server

MySQL

  • Server: localhost via TCP/IP
  • Server Version: 5.5.16
  • Protokoll-Version: 10
  • Benutzer: root@localhost
  • MySQL-Zeichensatz: UTF-8 Unicode (utf8)

Webserver

  • Apache/2.2.21 (Win32) mod_ssl/2.2.21 OpenSSL/1.0.0e PHP/5.3.8 mod_perl/2.0.4 Perl/v5.10.1
  • MySQL-Client-Version: mysqlnd 5.0.8-dev - 20102224 - $Revision: 310735 $
  • PHP Erweiterung: mysql 
How can I know the version of mysql.dll? (I don't know steps to know libmysql.dll version)


Can you install dep_walker gem and run:

gem_walker -c mysql2 -t

This will print out the full path to the libmysql.dll. In Windows Explorer right click on the dll and choose properties. On the details tab you will find File version and Product version information.

Next you should try to use mysql2 gem outside of Rails. Use irb with following:

irb -r mysql2
client = Mysql2::Client.new(:host => "localhost", :username => "root")

You can use :password in constructor if needed. If connection is establish just try to execute any query with:

client.query("select * from ...")


Rajiv Kaushal

unread,
Oct 25, 2011, 5:56:02 AM10/25/11
to rubyin...@googlegroups.com
Hi Ivanišević,

libmysqld.dll version is 5.5.16.0.

C:\ruby_projects>gem install dep_walker --no-ri --no-rdoc
Fetching: dep_walker-1.0.2.gem (100%)
ERROR:  Error installing dep_walker:dep_walker requires RubyGems version >= 1.8.0. 
Try 'gem update --system' to update RubyGems itself.
C:\ruby_projects>gem -v
1.7.2

So, I run the following steps:
I uninstalled ruby gem 1.8.5 in directory rubygems-1.8.5. and run the following command below:

C:\Users\dell\Downloads\ruby\rubygems\rubygems-1.8.5>ruby setup.rb
RubyGems 1.8.5 installed
unable to convert U+0160 from UTF-8 to IBM437 for History.txt, skipping
unable to convert U+0160 from UTF-8 to IBM437 for History.txt, skipping

=== 1.8.4 / 2011-05-31
* 1 minor enhancement:

  * The -u option to 'update local source cache' is official deprecated.
  * Remove has_rdoc deprecations from Specification.
* 2 bug fixes:

  * Handle bad specs more gracefully.
  * Reset any Gem paths changed in the installer.
------------------------------------------------------------------------------
RubyGems installed the following executables:
        C:/Ruby192/bin/gem


C:\Users\dell\Downloads\ruby\rubygems\rubygems-1.8.5>gem -v
1.8.5

Next Step:
C:\ruby_projects>gem_walker -c mysql2 -t
'gem_walker' is not recognized as an internal or external command,
operable program or batch file.

C:\ruby_projects>ruby gem_walker -c mysql2 -t
ruby: No such file or directory -- gem_walker (LoadError)

I could not run the command successfully [gem_walker -c mysql2 -t]. How should I run it?

Next Step:

C:\ruby_projects>irb -r mysql2
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
Incorrect MySQL client library version! This gem was compiled for 5.5.15 but the client library is 5.0.51b. (RuntimeError)
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/lib/mysql2.rb:9:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:33:in `require'
        from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from C:/Ruby192/lib/ruby/1.9.1/irb/init.rb:281:in `block in load_modules'
        from C:/Ruby192/lib/ruby/1.9.1/irb/init.rb:279:in `each'
        from C:/Ruby192/lib/ruby/1.9.1/irb/init.rb:279:in `load_modules'
        from C:/Ruby192/lib/ruby/1.9.1/irb/init.rb:20:in `setup'
        from C:/Ruby192/lib/ruby/1.9.1/irb.rb:53:in `start'
        from C:/Ruby192/bin/irb:12:in `<main>'

These are all steps which I run.

What should I do next?

Best Regards,

Boško Ivanišević

unread,
Oct 25, 2011, 9:14:00 AM10/25/11
to rubyin...@googlegroups.com
On Tue, Oct 25, 2011 at 11:56 AM, Rajiv Kaushal <kalya...@gmail.com> wrote:
Hi Ivanišević,

Before running this you should install dep_walker gem. Notice that command is not gem_walker but dep_walker and it is available when gem is installed.
 
C:\ruby_projects>ruby gem_walker -c mysql2 -t
ruby: No such file or directory -- gem_walker (LoadError)

I could not run the command successfully [gem_walker -c mysql2 -t]. How should I run it?

Next Step:

C:\ruby_projects>irb -r mysql2
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
Incorrect MySQL client library version! This gem was compiled for 5.5.15 but the client library is 5.0.51b. (RuntimeError)
        from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/lib/mysql2.rb:9:in `<top (required)>'
        from <internal:lib/rubygems/custom_require>:33:in `require'
        from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
        from <internal:lib/rubygems/custom_require>:29:in `require'
        from C:/Ruby192/lib/ruby/1.9.1/irb/init.rb:281:in `block in load_modules'
        from C:/Ruby192/lib/ruby/1.9.1/irb/init.rb:279:in `each'
        from C:/Ruby192/lib/ruby/1.9.1/irb/init.rb:279:in `load_modules'
        from C:/Ruby192/lib/ruby/1.9.1/irb/init.rb:20:in `setup'
        from C:/Ruby192/lib/ruby/1.9.1/irb.rb:53:in `start'
        from C:/Ruby192/bin/irb:12:in `<main>'

These are all steps which I run.

What should I do next?


From this error I would say that you used mysql 5.5.15 sources and version of libmysql.dll is 5.0.51b. Try to find libmysql.dll on your path and check it's version. Gem dep_walker would help you in that part since it will print out full path from which libmysql.dll will be loaded by mysql2 gem.

When you find location of dll just replace that dll with the dll you should have in some sub-directory of  C:\xampp\mysql directory.

Rajiv Kaushal

unread,
Oct 25, 2011, 9:53:45 AM10/25/11
to rubyin...@googlegroups.com
Hi Ivanišević,

I got this after running  dep_walker -c mysql2 -t

C:\ruby_projects>dep_walker -c mysql2 -t
Checking mysql2-0.3.7
  C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/ext/mysql2/mysql2.so
    msvcrt-ruby191.dll -> Found at C:\Ruby192\bin
    libmysql.dll -> Found at C:\Windows\system32
    kernel32.dll -> Found at C:\Windows\system32
    msvcrt.dll -> Found at C:\Windows\system32
  C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.7/lib/mysql2/mysql2.so
    msvcrt-ruby191.dll -> Found at C:\Ruby192\bin
    libmysql.dll -> Found at C:\Windows\system32
    kernel32.dll -> Found at C:\Windows\system32
    msvcrt.dll -> Found at C:\Windows\system32
========================================
All dependencies found

Thanks and Regards,

Rajiv Kaushal

unread,
Oct 25, 2011, 10:04:50 AM10/25/11
to rubyin...@googlegroups.com
Hi Ivanišević,

Thanks a Lot, I replaced a libmysql.dll file in C:\Windows\System32 and it worked.You are genius. 
Now, when I am running rake db:create, I am getting the error.
Can you please suggest me how to fix this? Is it related to existing problem that you helped to fix.


C:\ruby_projects\suppression1>rake db:create
(in C:/ruby_projects/suppression1)
rake aborted!
uninitialized constant Rake::DSL
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/tasklib.rb:6:in `<module:Rake>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/tasklib.rb:3:in `<top(required)>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/testtask.rb:4:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/testtask.rb:4:in `<top (required)>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/test_unit/testing.rake:2:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/test_unit/testing.rake:2:in `<top (required)>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/test_unit/railtie.rb:12:in `load'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/test_unit/railtie.rb:12:in `block in <class:TestUnitRailtie>'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/railtie.rb:183:in `call'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/railtie.rb:183:in `block in load_tasks'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/railtie.rb:183:in `each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/railtie.rb:183:in `load_tasks'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/engine.rb:396:in `block in load_tasks'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/application/railties.rb:8:in `each'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/application/railties.rb:8:in `all'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/engine.rb:396:in `load_tasks'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/application.rb:103:in `load_tasks'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.1.1.rc3/lib/rails/railtie/configurable.rb:30:in `method_missing'
C:/ruby_projects/suppression1/Rakefile:7: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>'

Thanks and Regards,

Rajiv Kaushal

unread,
Oct 25, 2011, 10:36:20 AM10/25/11
to rubyin...@googlegroups.com
Hi Ivanišević,

Below is my gem list (if it can help to fix the mine problem):
Error I am getting:


[
(in C:/ruby_projects/suppression1)
rake aborted!
uninitialized constant Rake::DSL
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/rake-0.9.2.2/lib/rake/tasklib.rb:8:in `<class:TaskLib>'
]

gem list

*** LOCAL GEMS ***

aasm (2.2.0)
abstract (1.0.0)
actionmailer (3.1.1.rc3, 3.0.9)
actionpack (3.1.1.rc3, 3.0.9)
activemodel (3.1.1.rc3, 3.0.9)
activerecord (3.1.1.rc3, 3.0.9)
activeresource (3.1.1.rc3, 3.0.9)
activesupport (3.1.1.rc3, 3.0.9)
ansi (1.3.0)
arel (2.2.1, 2.0.10)
bcrypt-ruby (2.1.4 x86-mingw32)
builder (3.0.0, 2.1.2)
bundler (1.0.21)
capistrano (2.8.0)
capistrano-ext (1.2.1)
coffee-rails (3.1.1)
coffee-script (2.2.0)
coffee-script-source (1.1.2)
columnize (0.3.4)
configatron (2.8.2)
declarative_authorization (0.5.3)
dep_walker (1.0.2)
devise (1.4.2)
diff-lcs (1.1.2)
erubis (2.7.0, 2.6.6)
execjs (1.2.9)
gravatar_image_tag (1.0.0)
highline (1.6.2)
hike (1.2.1)
i18n (0.6.0, 0.5.0)
jquery-rails (1.0.16)
json (1.6.1, 1.5.3)
mail (2.3.0, 2.2.19)
mime-types (1.17.1, 1.16)
minitest (1.6.0)
multi_json (1.0.3)
mysql2 (0.3.7)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.1.4)
net-ssh-gateway (1.1.0)
orm_adapter (0.0.5)
polyglot (0.3.2)
rack (1.3.5, 1.2.3)
rack-cache (1.1)
rack-mount (0.8.3, 0.6.14)
rack-ssl (1.3.2)
rack-test (0.6.1, 0.5.7)
rails (3.1.1.rc3)
railties (3.1.1.rc3)
rake (0.9.2.2, 0.9.2, 0.8.7)
rdoc (3.11, 2.5.8)
sass (3.1.10)
sass-rails (3.1.4)
sprockets (2.0.3)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
turn (0.8.3)
tzinfo (0.3.30, 0.3.29)
uglifier (1.0.4)
warden (1.0.5)
yamler (0.1.0)

Thanks and Regards,

Rajiv Kaushal

Luis Lavena

unread,
Oct 25, 2011, 10:40:46 AM10/25/11
to rubyin...@googlegroups.com
On Tue, Oct 25, 2011 at 12:54 AM, rajiv74 <kalya...@gmail.com> wrote:
> Hi
>
> I am getting this error on windows machine. I am using a window vista.
> I could not get success for making connection with mysql.
> I am getting the same error with all almost all versions of rails.
> Sometimes I am getting error "This gem was compiled for 6.0.x but the
> client library is 5.0.51b." Some times "This gem was compiled for
> 5.5.15 but the client library is 5.0.51b." Please help to fix this
> issue for my window machine(Window Vista).

The problem is libmysql.dll that you have somewhere in your PATH.

Please do:

where libmysql.dll

And will display the locations, there should be *only one*. If more
are listed, Ruby might be loading the wrong one.

To avoid any of those issues, you can ensure that Ruby is first in the
PATH (using "Start Command Prompt with Ruby) and ensure that the
libmysql.dll is the same used for the mysql gem.

Since is highly unlikely you're going to find libmysql.dll from MySQL
5.0.x, you should follow this guide:

http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/


Also,

I believe I've mentioned to you on other email (think Ruby On Rails
group) that you should cleanup your RubyGems sources:

gem sources --clear-all
gem sources --add http://rubygems.org
gem sources --add http://gems.github.com

And remove the obsolete gems.rubyforge.org that no longer exists.

--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry

Rajiv Kaushal

unread,
Oct 25, 2011, 11:01:18 AM10/25/11
to rubyin...@googlegroups.com
Hi Luis,

I just fixed this probem. Boško Ivanišević <bosko.iv...@gmail.com> helped me to fix this problem. You are right. The problem was with wrong path for libmysql.dll. But after fixing this problem, I am getting one more problem. Can you please help me to fix this one.

Below it is ;
Below is my gem list (if it can help to fix the mine problem):
Error I am getting:
[
]

gem list

*** LOCAL GEMS ***

aasm (2.2.0)
abstract (1.0.0)
actionmailer (3.1.1.rc3, 3.0.9)
actionpack (3.1.1.rc3, 3.0.9)
activemodel (3.1.1.rc3, 3.0.9)
activerecord (3.1.1.rc3, 3.0.9)
activeresource (3.1.1.rc3, 3.0.9)
activesupport (3.1.1.rc3, 3.0.9)
ansi (1.3.0)
arel (2.2.1, 2.0.10)
bcrypt-ruby (2.1.4 x86-mingw32)
builder (3.0.0, 2.1.2)
bundler (1.0.21)
capistrano (2.8.0)
capistrano-ext (1.2.1)
coffee-rails (3.1.1)
coffee-script (2.2.0)
coffee-script-source (1.1.2)
columnize (0.3.4)
configatron (2.8.2)
declarative_authorization (0.5.3)
dep_walker (1.0.2)
devise (1.4.2)
diff-lcs (1.1.2)
erubis (2.7.0, 2.6.6)
execjs (1.2.9)
gravatar_image_tag (1.0.0)
highline (1.6.2)
hike (1.2.1)
i18n (0.6.0, 0.5.0)
jquery-rails (1.0.16)
json (1.6.1, 1.5.3)
mail (2.3.0, 2.2.19)
mime-types (1.17.1, 1.16)
minitest (1.6.0)
multi_json (1.0.3)
mysql2 (0.3.7)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.1.4)
net-ssh-gateway (1.1.0)
orm_adapter (0.0.5)
polyglot (0.3.2)
rack (1.3.5, 1.2.3)
rack-cache (1.1)
rack-mount (0.8.3, 0.6.14)
rack-ssl (1.3.2)
rack-test (0.6.1, 0.5.7)
rails (3.1.1.rc3)
railties (3.1.1.rc3)
rake (0.9.2.2, 0.9.2, 0.8.7)
rdoc (3.11, 2.5.8)
sass (3.1.10)
sass-rails (3.1.4)
sprockets (2.0.3)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
turn (0.8.3)
tzinfo (0.3.30, 0.3.29)
uglifier (1.0.4)
warden (1.0.5)
yamler (0.1.0)

Thanks and Regards,

Rajiv Kaushal

--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.

Phillip Gawlowski

unread,
Oct 25, 2011, 11:01:34 AM10/25/11
to rubyin...@googlegroups.com
On Tue, Oct 25, 2011 at 4:40 PM, Luis Lavena <luisl...@gmail.com> wrote:
>
> And remove the obsolete gems.rubyforge.org that no longer exists.

I get a redirect there.

--
Phillip Gawlowski

gplus.to/phgaw | twitter.com/phgaw

A method of solution is perfect if we can forsee from the start,
and even prove, that following that method we shall attain our aim.
              -- Leibniz

Luis Lavena

unread,
Oct 25, 2011, 11:07:09 AM10/25/11
to rubyin...@googlegroups.com
On Tue, Oct 25, 2011 at 12:01 PM, Rajiv Kaushal <kalya...@gmail.com> wrote:
> Hi Luis,
>
> I just fixed this probem. Boško Ivanišević <bosko.iv...@gmail.com>
> helped me to fix this problem. You are right. The problem was with wrong
> path for libmysql.dll. But after fixing this problem, I am getting one more
> problem. Can you please help me to fix this one.
> Below it is ;
> Below is my gem list (if it can help to fix the mine problem):
> Error I am getting:
> [
> C:\ruby_projects\suppression1>rake db:create
> (in C:/ruby_projects/suppression1)
> rake aborted!
> uninitialized constant Rake::DSL

gem install rake -v 0.8.7

Seems you're project might not be ready for newer versions of Rake and
thus is failing.

I recommend you use Bundler to manage the gem dependencies of your project:

http://gembundler.com/
http://gembundler.com/rails23.html

Hope that helps,

Rajiv Kaushal

unread,
Oct 25, 2011, 12:08:41 PM10/25/11
to rubyin...@googlegroups.com
Hi Luis,

It was happening to me for all new projects. I was using this command for creating new project:
rails new sample -d mysql

But after installing gem [gem install rake -v 0.8.7], I am able to create new projects without errors. Don't know why it was happening with previous gem list. May I know but was the problem with previous rake versions?

A lot of thanks for solving my problem

Thanks and Regards,

Rajiv Kaushal

--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.

Rajiv Kaushal

unread,
Dec 13, 2011, 11:40:59 AM12/13/11
to rubyin...@googlegroups.com
Hi,

I am getting error on my machine while creating any new application with command [rails new facebook -d mysql]:
I am getting this error for all new applications that I am trying to create when bundle install is running.

Installing json (1.6.3) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        C:/Ruby192/bin/ruby.exe extconf.rb
creating Makefile

make


Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.3 for inspection.
Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/json-1.6.3/ext/json/ext/parser/gem_make.out
An error occured while installing json (1.6.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.6.3'` succeeds before bundling.

I am using window vista (system 32).

I have the following gem list:

======================
aasm (2.2.0)
abstract (1.0.0)
actionmailer (3.1.1.rc3, 3.0.9)
actionpack (3.1.1.rc3, 3.0.9)
activemodel (3.1.1.rc3, 3.0.9)
activerecord (3.1.1.rc3, 3.0.9)
activeresource (3.1.1.rc3, 3.0.9)
activesupport (3.1.1.rc3, 3.0.9)
addressable (2.2.6)
ansi (1.4.1, 1.3.0)
arel (2.2.1, 2.0.10)
bcrypt-ruby (3.0.1 x86-mingw32, 2.1.4 x86-mingw32)
builder (3.0.0, 2.1.2)
bundler (1.0.21)
cancan (1.6.7)
capistrano (2.8.0)
capistrano-ext (1.2.1)
ckeditor (3.5.0)
cocaine (0.2.0)
coffee-rails (3.1.1)
coffee-script (2.2.0)
coffee-script-source (1.1.3, 1.1.2)
columnize (0.3.4)
configatron (2.8.2)
daemons (1.1.4)
declarative_authorization (0.5.3)
delayed_job (2.1.4)
dep_walker (1.0.2)
devise (1.4.2)
diff-lcs (1.1.2)
domainatrix (0.0.10)
erubis (2.7.0, 2.6.6)
execjs (1.2.12, 1.2.11, 1.2.9)
faraday (0.7.5)
gravatar_image_tag (1.0.0)
highline (1.6.2)
hike (1.2.1)
i18n (0.6.0, 0.5.0)
jquery-rails (1.0.17, 1.0.16)
json (1.6.1, 1.5.3)
mail (2.3.0, 2.2.19)
mime-types (1.17.2, 1.17.1, 1.16)
minitest (1.6.0)
multi_json (1.0.4, 1.0.3)
multipart-post (1.1.4)
mysql2 (0.3.7)
net-scp (1.0.4)
net-sftp (2.0.5)
net-ssh (2.1.4)
net-ssh-gateway (1.1.0)
oauth (0.4.5)
orm_adapter (0.0.5)
paperclip (2.4.5)
polyglot (0.3.3, 0.3.2)
rack (1.3.5, 1.2.3)
rack-cache (1.1)
rack-mount (0.8.3, 0.6.14)
rack-ssl (1.3.2)
rack-test (0.6.1, 0.5.7)
rails (3.1.1.rc3)
railties (3.1.1.rc3)
rake (0.9.2.2, 0.9.2, 0.8.7)
rdoc (3.11, 2.5.8)
rest-client (1.6.7)
sass (3.1.10)
sass-rails (3.1.4)
simple_oauth (0.1.5)
sprockets (2.0.3)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
turn (0.8.3)
twitter (2.0.1)
tzinfo (0.3.31, 0.3.30, 0.3.29)
uglifier (1.0.4)
warden (1.0.5)
yamler (0.1.0)
======================
My gem environment is:
C:\ruby_projects\social>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.5
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby192/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: C:/Ruby192/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby192/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - C:/Ruby192/lib/ruby/gems/1.9.1
     - C:/Users/dell/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "update" => "--env-shebang"
     - "install" => "--env-shebang"
  - REMOTE SOURCES:

Rajiv Kaushal

unread,
Dec 13, 2011, 11:47:13 AM12/13/11
to rubyin...@googlegroups.com
Hi Ivanišević,

builder (3.0.0, 2.1.2)
bundler (1.0.21)
cancan (1.6.7)
capistrano (2.8.0)
capistrano-ext (1.2.1)
ckeditor (3.5.0)
cocaine (0.2.0)
coffee-rails (3.1.1)
coffee-script (2.2.0)
rack (1.3.5, 1.2.3)
rack-cache (1.1)
rack-mount (0.8.3, 0.6.14)
rack-ssl (1.3.2)
rack-test (0.6.1, 0.5.7)
rails (3.1.1.rc3)
railties (3.1.1.rc3)
rake (0.9.2.2, 0.9.2, 0.8.7)
rdoc (3.11, 2.5.8)
rest-client (1.6.7)
sass (3.1.10)
sass-rails (3.1.4)
simple_oauth (0.1.5)
sprockets (2.0.3)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
turn (0.8.3)
twitter (2.0.1)
tzinfo (0.3.31, 0.3.30, 0.3.29)
uglifier (1.0.4)
warden (1.0.5)
yamler (0.1.0)
======================
My gem environment is:
C:\ruby_projects\social>gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.5
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [i386-mingw32]
  - INSTALLATION DIRECTORY: C:/Ruby192/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: C:/Ruby192/bin/ruby.exe
  - EXECUTABLE DIRECTORY: C:/Ruby192/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86-mingw32
  - GEM PATHS:
     - C:/Ruby192/lib/ruby/gems/1.9.1
     - C:/Users/dell/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "update" => "--env-shebang"
     - "install" => "--env-shebang"
  - REMOTE SOURCES:

Please help me to fix this problem.

Thanks and Regards,

Rajiv Kaushal

Luis Lavena

unread,
Dec 13, 2011, 12:09:22 PM12/13/11
to rubyin...@googlegroups.com
On Tue, Dec 13, 2011 at 1:40 PM, Rajiv Kaushal <kalya...@gmail.com> wrote:
> Hi,
>
> I am getting error on my machine while creating any new application with
> command [rails new facebook -d mysql]:
> I am getting this error for all new applications that I am trying to create
> when bundle install is running.
>
> Installing json (1.6.3) with native extensions
> Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native
> extension.
>
>         C:/Ruby192/bin/ruby.exe extconf.rb
> creating Makefile
>
> make
>

Please see Troubleshooting page:

https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-gems_fails_comspec_autorun

I believe I've also recommended clean up gem sources:

gem sources --clear


gem sources --add http://rubygems.org
gem sources --add http://gems.github.com

PS: do not top post, please respond inline.

Rajiv Kaushal

unread,
Dec 21, 2011, 1:26:11 AM12/21/11
to rubyin...@googlegroups.com
Subject: Failure connecting mysql

I am having window vista basic where I am installing Ruby.

I am getting the following error for every application
C:\ruby_projects\sandy>rake db:create
(in C:/ruby_projects/sandy)

Can't connect to MySQL server on 'localhost' (10061)
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnec
t"=>false, "database"=>"sandy_test", "pool"=>5, "username"=>"root", "password"=>nil, "host"=>"localhost"}, charset: , collation:

Can't connect to MySQL server on 'localhost' (10061)
Couldn't create database for {"adapter"=>"mysql2", "encoding"=>"utf8", "reconnec
t"=>false, "database"=>"sandy_development", "pool"=>10, "username"=>"root", "password"=>nil, "host"=>"localhost"}, charset: , collation:
--------------------------------------------------------------------------
I tried to install by the following command:
gem install mysql2 -- --with-mysql-lib = "C:\xampp\mysql\bin" --with-mysql-include = "C:\xampp\mysql\bin" 
and enen with this:
--------------------------------------------------------------------------
gem install mysql2 -- --with-mysql-lib = "C:\mysql-connector-c-noinstall-6.0.2-win32\lib" --with-mysql-include = "C:\mysql-connector-c-noinstall-6.0.2-win32\bin"
--------------------------------------------------------------------------
After running this command, I got this:

You've installed the binary version of mysql2.
  It was built using MySQL Connector/C version 6.0.2.
  It's recommended to use the exact same version to avoid potential issues.

  At the time of building this gem, the necessary DLL files where available
  in the following download:


  And put lib\libmysql.dll file in your Ruby bin directory, for example C:\Ruby\bin

  After copying lib\libmysql.dll from mysql connector to ruby bin directory, I was still getting this error.
--------------------------------------------------------------------------
C:\ruby_projects\sandy>dep_walker -c mysql2 -t
Checking mysql2-0.3.11-x86-mingw32
  C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.8/m
ysql2.so
    libmysql.dll -> Found at C:\Ruby192\bin
    kernel32.dll -> Found at C:\Windows\system32
    msvcrt.dll -> Found at C:\Windows\system32
  C:/Ruby192/lib/ruby/gems/1.9.1/gems/mysql2-0.3.11-x86-mingw32/lib/mysql2/1.9/m
ysql2.so
    msvcrt-ruby191.dll -> Found at C:\Ruby192\bin
    libmysql.dll -> Found at C:\Ruby192\bin
    kernel32.dll -> Found at C:\Windows\system32
    msvcrt.dll -> Found at C:\Windows\system32
----------------------------------------------
Please help me to resolve this issue.

Phillip Gawlowski

unread,
Dec 21, 2011, 2:27:08 AM12/21/11
to rubyin...@googlegroups.com
On Wed, Dec 21, 2011 at 7:26 AM, Rajiv Kaushal <kalya...@gmail.com> wrote:
> After running this command, I got this:
>
> You've installed the binary version of mysql2.
>   It was built using MySQL Connector/C version 6.0.2.
>   It's recommended to use the exact same version to avoid potential issues.
>
>   At the time of building this gem, the necessary DLL files where available
>   in the following download:
>
>
> http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick
>
>   And put lib\libmysql.dll file in your Ruby bin directory, for example
> C:\Ruby\bin
>
>   After copying lib\libmysql.dll from mysql connector to ruby bin directory,
> I was still getting this error.
> --------------------------------------------------------------------------
>
> C:\ruby_projects\sandy>dep_walker -c mysql2 -t
> Checking mysql2-0.3.11-x86-mingw32

[...]

>
> Please help me to resolve this issue.

Have you tried installing the correct MySQL/C connector as the error
message instructs you to?

You are downloading a pre-compiled binary, so any sort of compiling
switches you pass on your end won't work, since there's nothing to
compile to begin with...

Rajiv Kaushal

unread,
Dec 21, 2011, 3:07:49 AM12/21/11
to rubyin...@googlegroups.com
Hi,

     Yes, I have tried correct version which I was getting in message. I copied dll file from connector [http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick,  I have already downloaded this and extracted to one of my directory] to ruby bin directory. I have installed ruby gem mysql2 by [gem install mysql2 -- --with-mysql-lib = "C:\mysql-connector-c-noinstall-6.0.2-win32\lib" --with-mysql-include = "C:\mysql-connector-c-noinstall-6.0.2-win32\bin"]

Thanks and Regards,

Rajiv kaushal


--
You received this message because you are subscribed to the Google Groups "RubyInstaller" group.
To post to this group, send email to rubyin...@googlegroups.com.
To unsubscribe from this group, send email to rubyinstalle...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyinstaller?hl=en.

Luis Lavena

unread,
Dec 21, 2011, 5:18:38 AM12/21/11
to rubyin...@googlegroups.com
On Wed, Dec 21, 2011 at 5:07 AM, Rajiv Kaushal <kalya...@gmail.com> wrote:
> Hi,
>
>      Yes, I have tried correct version which I was getting in message. I
> copied dll file from connector
> [http://dev.mysql.com/get/Downloads/Connector-C/mysql-connector-c-noinstall-6.0.2-win32.zip/from/pick,
>  I have already downloaded this and extracted to one of my directory] to
> ruby bin directory. I have installed ruby gem mysql2 by [gem install mysql2
> -- --with-mysql-lib = "C:\mysql-connector-c-noinstall-6.0.2-win32\lib"
> --with-mysql-include = "C:\mysql-connector-c-noinstall-6.0.2-win32\bin"]
>

Dunno how to say this without sound harsh but: you're doing it wrong.

Please read again my instructions, the blog post and my responses to
you on this thread already:

1) I've never mentioned using --with-mysql-include and point it to the
"bin" directory.

The bin directory contains the DLL, is pointless point Ruby to look up
for includes there.

2) Verify that there is only one libmysql.dll in your PATH

If you're under Windows Vista/7, you could at the command prompt:

where libmysql.dll

And verify that is pointing to the DLL *you copied* from the extract
of MySQL Connector/C *in* Ruby's bin directory.

3) Last but not least, use --platform=ruby during gem installation

This is an important point mentioned in my instructions. If you plan
to use the extracted MySQL Connector/C, you *need* to specific
--platform=ruby so it forces the compilation of the extension.

At this time you're installing the pre-built binary, that is why
you're receiving the post install message after you installed the gem.

Please:

gem install mysql2 --platform=ruby --
--with-mysql-dir=C:/mysql-connector-c-extracted-dir

Or re-read again the instructions in the blog post:
http://blog.mmediasys.com/2011/07/07/installing-mysql-on-windows-7-x64-and-using-ruby-with-it/

Reply all
Reply to author
Forward
0 new messages