Re: [RubyInstaller] Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64)

Showing 1-19 of 19 messages
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
and libraries.

For example, here is an article about compiling mysql gem against
MySQL Connector/C:

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

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 --
--with-mysql-dir=C:/mysql-connector-64"

(replace mysql-connector-64 with the directory where you extracted
MySQL Connector/C for 64bits)

Regards,
--
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
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.

On Thursday, March 21, 2013 1:21:22 AM UTC-6, Craig Walsh 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. 

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


On Thursday, March 21, 2013 10:23:39 AM UTC-6, Craig Walsh wrote:
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.

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]

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
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:
>
>
> On Thursday, March 21, 2013 10:23:39 AM UTC-6, Craig Walsh wrote:
>>
>> 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.
>
>
> 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]
>

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:
> 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.
>

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.
Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64) Luis Lavena 7/3/13 3:15 AM
Hello Chris,

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.

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



--
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
unk...@googlegroups.com 7/5/13 5:47 AM <This message has been deleted.>
Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64) Luis Lavena 7/7/13 10:54 AM
Hello Badal,

On Fri, Jul 5, 2013 at 9:47 AM, Badal <mic...@demazure.com> wrote:

Dear Luis,

You cite this as a path to the solution
It requires the use of dlltool.
Do you know where to find a dlltool.exe compiled by mingw64 (same level as the 64 bits devkit) ?


dlltool is part of the DevKit, you simply need to enable MinGW in the PATH by running "devkitvars.bat"

C:\Users\Luis>C:\Users\Luis\Tools\DevKit\mingw64-64-4.7.2\devkitvars.bat
Adding the DevKit to PATH...

C:\Users\Luis>dlltool --version
GNU dlltool (rubenvb-4.7.2-release) 2.23.51.20120920
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.

Thank you.
-- 
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
Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64) Badal 7/8/13 1:15 AM


Le dimanche 7 juillet 2013 19:54:52 UTC+2, Luis Lavena a écrit :
Hello Badal,

dlltool is part of the DevKit, you simply need to enable MinGW in the PATH by running "devkitvars.bat"

==> Thanks. I should have looked there. Shame on me !


gendef might require compilation from source:


I pre-compiled it for you:


==> Thanks a lot again.

_md (badal)

Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64) Badal 7/8/13 1:49 AM

FWIW : there is a patched connector available, thanks to 'mgoggin'. From his comment (URL below)

https://groups.google.com/forum/#!topic/rubyinstaller/uTNffOt6Yqo

" 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


Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64) 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 ***
Could not create Makefile due to some reason, probably lack of necessary
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.

Thanks!
Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64) mc2 8/11/13 1:22 PM
Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64) Luis Lavena 8/11/13 1:23 PM
Hello,

On Sun, Aug 11, 2013 at 4:52 PM, mc2 <mark.c...@gmail.com> wrote:
the command: gem install mysql2 --platform=ruby -- --with_opt-dir=C:\mysql-connector-c-noinstall-6.0.2-winx64

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.
 

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 ***
Could not create Makefile due to some reason, probably lack of necessary
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


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.
 
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.


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.

--
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
Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64) 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:
Hello,

On Sun, Aug 11, 2013 at 4:52 PM, mc2 <mark.c...@gmail.com> wrote:
the command: gem install mysql2 --platform=ruby -- --with_opt-dir=C:\mysql-connector-c-noinstall-6.0.2-winx64

The option is --with-opt-dir, there is no underscore in there.

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
  
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 threa
Yes, used pre-patched ZIP of the C Connector 6.0.2 64-bit: https://copy.com/CHZ4eT4us6f1 
 
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 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 :)
Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64) ke...@novafabrica.com 10/7/13 7:14 AM
Luis,

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.

Thank you,
Kevin

Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64) 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.

Thanks
BMWX5
Re: [RubyInstaller] Re: Devkit won't build native extensions for Mysql or Mysql2 (Ruby 2.0-64, Devkit 64) 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.