|Re: [RubyInstaller] Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64)||Luis Lavena||3/21/13 6:38 AM|
Hello Craig, welcome,
On Thu, Mar 21, 2013 at 4:21 AM, Craig Walsh <cricha...@gmail.com> wrote:
> "Could not create Makefile due to some reason, probably lack of necessary
> libraries and/or headers."
> Was able to install json gem without errors.
> Worth a try before re-installing previous version.
Just to confirm:
Ruby 2.0.0, x64 version + mingw64-64-4.7.2 DevKit, correct?
Installed without issues json using "gem install json --platform=ruby", correct?
For MySQL, did you obtain headers and libraries for the 64bits version?
MySQL extension differs from JSON in that it requires external headers
For example, here is an article about compiling mysql gem against
The instructions works for both mysql and mysql2 gem.
In your case, you will need to obtain MySQL Connector/C 64bits version
and use that instead.
Can you paste the output of "gem install mysql --platform=ruby --
(replace mysql-connector-64 with the directory where you extracted
MySQL Connector/C for 64bits)
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
|Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64)||Craig Walsh||3/21/13 8:37 AM|
It worked, thanks. Still working on other issues with bundle install.
|Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64)||Craig Walsh||3/21/13 9:23 AM|
Here's what i used: gem install mysql --platform=ruby -- --with-mysql-include=C:\mysql-connector-c-noinstall-6.0.2-winx64\include --with-mysql-lib=C:\mysql-connector-c-noinstall-6.0.2-winx64\lib
Works for mysql2 also.
|Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64)||Craig Walsh||3/21/13 10:08 AM|
Here's the rake error I'm getting:
[rake --tasks] C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/mysql2-0.3.11/lib/mysql2/mysql2.so: [BUG] Segmentation fault
ruby 2.0.0p0 (2013-02-24) [x64-mingw32]
-- Control frame information -----------------------------------------------
c:0026 p:-8826948 s:0087 e:000086 TOP [FINISH]
c:0025 p:---- s:0085 e:000084 CFUNC :require
....[I've deleted a large portion of redundant errors]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
|Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64)||Luis Lavena||3/21/13 10:57 AM|
On Thu, Mar 21, 2013 at 2:08 PM, Craig Walsh <cricha...@gmail.com> wrote:Can you tell me if libmysql.dll is the ONLY libmysql.dll in the path?
You can do "where libmysql.dll" and should tell you the locations.
You can use "Dependency Walker" to determine the architecture of the
DLL (if is 32 or 64bits)
I'm not sure if MySQL Connector/C uses msvcrt.dll, most likely
requires a newer version of it, which can be a problem.
|Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64)||Craig Walsh||3/22/13 9:14 AM|
I've switched back to 1.9.3, but I'll re-install 2.0 over the weekend and let you know . Ruby 2.0 was a clean install (everything removed prior to). My path to the libmysql.dll has always been ruby/bin and copied the dll to that directory from the appropriate C connector directory. Ran "where" on current config and confirmed the only location.
|Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64)||Luis Lavena||3/22/13 10:48 AM|
On Fri, Mar 22, 2013 at 1:14 PM, Craig Walsh <cricha...@gmail.com> wrote:This is most likely what I feared: the compiled version of
libmysql.dll might be linking to a different CRT and that might be
causing the segfaults.
I'm going to check over the weekend and see what is going on.
|Luis Lavena||7/3/13 3:15 AM|
Sorry for the late response, but this come to my attention as the possible solution to the issue:
Also reported here:
On Wed, May 29, 2013 at 2:05 PM, Chris Mapes <m...@chrismapes.com> wrote:
Let us know what you find Luis, I'm experiencing the same issues as Craig. Unfortunately I've dumped over 6 hours into trying to get a working Windows 7 x64 + Ruby 2.0.0 + Mysql2 installation to work and it's just not happening. I'd love to see a fix.
|unk...@googlegroups.com||7/5/13 5:47 AM||<This message has been deleted.>|
|Luis Lavena||7/7/13 10:54 AM|
On Fri, Jul 5, 2013 at 9:47 AM, Badal <mic...@demazure.com> wrote:
dlltool is part of the DevKit, you simply need to enable MinGW in the PATH by running "devkitvars.bat"
Adding the DevKit to PATH...
GNU dlltool (rubenvb-4.7.2-release) 22.214.171.12420920
Copyright 2012 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) any later version.
This program has absolutely no warranty.
gendef might require compilation from source:
I pre-compiled it for you:
You can use that to follow the instructions provided.
I'm looking now into better ways to offer this as a solution and will follow up later.
|Badal||7/8/13 1:15 AM|
Le dimanche 7 juillet 2013 19:54:52 UTC+2, Luis Lavena a écrit :
==> Thanks a lot again.
|Badal||7/8/13 1:49 AM|
FWIW : there is a patched connector available, thanks to 'mgoggin'. From his comment (URL below)
" here's a pre-patched ZIP of the C Connector 6.0.2 64-bit: https://copy.com/CHZ4eT4us6f1 "
It works !
C:\Ruby200-x64\bin>gem install mysql2 --platform=ruby -- --with_opt-dir=C:\mysql-connector-c-noinstall-6.0.2-winx64
Fetching: mysql2-0.3.11.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions with: '--with_opt-dir=C:\mysql-connector-c-noinstall-6.0.2-winx64'
This could take a while...
Successfully installed mysql2-0.3.11
1 gem installed
|mc2||8/11/13 12:52 PM|
the command: gem install mysql2 --platform=ruby -- --with_opt-dir=C:\mysql-connector-c-noinstall-6.0.2-winx64
did not work for me, Error:
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
*** extconf.rb failed ***
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
but I now realize didn't run it from C:\Ruby200-x64\bin I don't think that should matter.
in a default command prompt, I had success with:
gem install --platform=ruby mysql2 -- --with-mysql-lib=C:\mysql-connector-c-noinstall-6.0.2-winx64\lib --with-mysql-include=C:\mysql-connector-c-noinstall-6.0.2-winx64\include
And after copying libmysql.dll to C:\Ruby200-x64\bin, creating the development db, setting the right connection string in \config\database.yml, rails server finally works.
Thanks for all help, and not to complain unduly, but using the pre-patched ZIP is a security hole for a production server.
If someone could create some short instructions for making gendef.exe from http://sourceforge.net/projects/mingw-w64/, perhaps using the DevKit gcc, I'd appreciate it.
Perhaps gendef.exe might be included in DevKit... Off to make the suggestion.
|mc2||8/11/13 1:22 PM|
oops, in https://bugs.ruby-lang.org/issues/8591#note-2 my browser shows the 404ing link for getting gendef.exe as
of course, it's https://structure-svm-map.googlecode.com/files/svm-map-win.zip
On Monday, July 8, 2013 1:49:16 AM UTC-7, Badal wrote:
|Luis Lavena||8/11/13 1:23 PM|
On Sun, Aug 11, 2013 at 4:52 PM, mc2 <mark.c...@gmail.com> wrote:
The option is --with-opt-dir, there is no underscore in there.
Please also note that the mysql connector lib do not work out of the box and needs to be regenerated, see the usage of gendef prior on this thread.
Here you used --with-mysql-lib and not --with-opt-dir or --with_opt-dir (which was wrong). If you want to discard a failure, you need to be consistent in the options given.
I see you openened a request for gendef in GitHub, gendef is not provided as binary so that will require compilation prior building the DevKit which adds more complexity (also, it forces to do a new DevKit release)
I'm working on fixing this in mysql gem and not at RubyInstaller.
|mc2||8/11/13 3:00 PM|
Sorry for the confusion,
On Sunday, August 11, 2013 1:23:41 PM UTC-7, Luis Lavena wrote:I meant the string as copied from Badal's post above. I did catch the underscore/dash and did run the following which could not create makefile on my Windows 7 machine:
gem install mysql2 --platform=ruby -- --with-opt-dir=C:\mysql-connector-c-noinstall-6.0.2-winx64
Yes, used pre-patched ZIP of the C Connector 6.0.2 64-bit: https://copy.com/CHZ4eT4us6f1
And hoped to help by pointing that out. If there's a need to debug why the --with-opt-dir flag isn't working, I'll be happy to help out further, otherwise I think I've done enough damage for now :)
|ke...@novafabrica.com||10/7/13 7:14 AM|
I am very interested in any progress that has been made on this issue. I am recording an online training video with instructions for beginners to get everything installed for Rails development (Windows 8 + Ruby 2.0 + DevKit + MySQL 5.6 + mysql2 gem + Rails 4). If we can make it work, hundreds of beginners will be using it. The mysql2 gem appears to compile but then seg faults when you require it. This is a blocking issue for us.
Copying the DLL file and compiling with options is about as complicated as it can get for beginners. Using gendef.exe, compiling new connectors, or downloading pre-compiled versions from third-party sites are not good solutions for us to recommend.
Any updates on a permanent fix or advice on workarounds would be appreciated. I'm very grateful for all of the work you put into this software.
|BMWX5||1/3/15 1:12 PM|
So based on your findings are there any straight forward installation as yet. This has been killing me to no avail. Please reply back with a link to the initial straight forward installation.
|Richard Campbell||1/8/15 6:56 AM|
This is only broken on 64 bit. If you need it working now just use 32 bit.