0

I have ruby version 2.0.0.0p195 (2013-05-14) [x64-mingw32] installed as well as ruby gem version 2.0.3 installed. I just recently installed MySQL Community Server 5.6.12 (32 bit) installer as well. I am trying to get the mysql or mysql2 gem to work and then get a server installed to learn more about Ruby on Rails.

When installing the mysql2 gem I get this error below, can anyone point me in the right direction to get mysql2 gem installed so i can use ruby on rails with mysql and then a web serer eventually.

Building native extensions. This could take awhile...

ERROR: Erorr intalling mysql2: ERROR: Failed to build gem native extension

> C:/Ruby200-x64/bin/ruby.exe extconf.rb checking for
> rb_thread_blocking_region()... *** 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.
> 
> Provided configuration options:   --with-opt-dir  --without-opt-dir
>   --with-opt-include  --without-opt-include=${opt-dir}/include
>   --with-opt-lib  --without-opt-lib=${opt-dir}/lib    --with-make-prog
>   --without-make-prog     --srcdir=.  --curdir
>   --ruby=C:/Ruby200-x64/bin/ruby
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:431:in `try_do': The compiler
> failed to generate an executable file. (RuntimeError) You have to
> install development tools first.  from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:516:in `try_link0'  from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:531:in `try_link'   from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:717:in `try_func'   from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1001:in `block in have_func'
>   from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:892:in `block in
> checking_for'     from C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:337:in
> `block (2 levels) in postpone'    from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:307:in `open'   from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:337:in `block in postpone'  from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:307:in `open'   from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:333:in `postpone'   from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:891:in `checking_for'   from
> C:/Ruby200-x64/lib/ruby/2.0.0/mkmf.rb:1000:in `have_func'     from
> extconf.rb:9:in `<main>'
kmalik
  • 109
  • 1
  • 2
  • 11
  • I've had insane amounts of trouble with this problem. I would actually recommend just using sqlite3 if you are just learning, especially if you're on a Windows 64bit machine. It's easy to get held up on the MySql thing for days. Here is a resource anyways if you want to try: http://www.gamecreatures.com/blog/2011/08/31/installing-ruby-on-rails-with-mysql-on-windows/ – Joe Essey Jun 09 '13 at 22:38
  • Will sqllite3 conflict with wamp server? I have that runnning for another project. Unless wamp and RoR can be integrated together. – kmalik Jun 11 '13 at 01:33
  • 1
    I'm not really familiar with WAMP, but as long as you use different shcema names you shouldn't have a problem. Another option is postgresql which I also find easier than MySQL. – Joe Essey Jun 11 '13 at 13:00

1 Answers1

0

I found the answer (for me) to be using rails installer and uninstalling my old ruby information. Rails installer includes ruby, rails and sqllite3. As well, then I installed WEBrick which runs off of localhost:3000. It allows me to have WAMP and Ruby/WEBrick. This isn't ideal since everything isn't running on one area, but is great for what I need it for which is learning and a side project I want to develop using HTML5 and/or Rails (a media application).

kmalik
  • 109
  • 1
  • 2
  • 11