Hi,
I have installed ruby 1.9.2, rails 3.0.0, mysql 5.1, Aptana Radrails,
Java,
On creating a new application using the below command line–
C:\ruby\bin\newproj>rails new newproj -d mysql
Installing mysql2 (0.2.4) with native extensions
C:/ruby/lib/ruby/1.9.1/rubygems
/installer.rb:483:in `rescue in block in build_extensions’: ERROR:
Failed to bui
ld gem native extension. (Gem::Installer::ExtensionBuildError)
C:/ruby/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.
If then i run
C:\ruby\bin\project1>gem install mysql2
The following is the output
Building native extensions. This could take a while…
ERROR: Error installing mysql2:
ERROR: Failed to build gem native extension.
C:/ruby/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:/ruby/bin/ruby
C:/ruby/lib/ruby/1.9.1/mkmf.rb:368:in try_do': The complier failed to generate an executable file. (RuntimeError) You have to install development tools first. from C:/ruby/lib/ruby/1.9.1/mkmf.rb:435:intry_link0’
from C:/ruby/lib/ruby/1.9.1/mkmf.rb:440:in try_link' from C:/ruby/lib/ruby/1.9.1/mkmf.rb:552:intry_func’
from C:/ruby/lib/ruby/1.9.1/mkmf.rb:797:in block in have_func' from C:/ruby/lib/ruby/1.9.1/mkmf.rb:693:inblock in
checking_for’
from C:/ruby/lib/ruby/1.9.1/mkmf.rb:280:in block (2 levels) in postpone ' from C:/ruby/lib/ruby/1.9.1/mkmf.rb:254:inopen’
from C:/ruby/lib/ruby/1.9.1/mkmf.rb:280:in block in postpone' from C:/ruby/lib/ruby/1.9.1/mkmf.rb:254:inopen’
from C:/ruby/lib/ruby/1.9.1/mkmf.rb:276:in postpone' from C:/ruby/lib/ruby/1.9.1/mkmf.rb:692:inchecking_for’
from C:/ruby/lib/ruby/1.9.1/mkmf.rb:796:in have_func' from extconf.rb:9:in’
Gem files will remain installed in
C:/ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.2.4
for inspection.
Results logged to
C:/ruby/lib/ruby/gems/1.9.1/gems/mysql2-0.2.4/ext/mysql2/gem_m
ake.out
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.
If then i run
C:\ruby\bin\project1>gem install mysql2
The following is the output
But since you’re just starting off with Rails, I would advise you to
simply run a Ubuntu Linux virtual machine (or even completely switch
to Linux right away) instead of frustrating yourself with Windows
problems and avoid even more issues with native library gems in the
future.
I m running Java VM on my system. Is there any luck with WIndows
that i
can expect of…???
I need to deliver a few projects pity quick and thats why i thought
RoR
would come handy…
Pls put your helping hands together…
You could run your Rails app under JRuby if you like, but that would
mean using the Java MySQL drivers instead. Java VM and a VMWare
virtual machine are two different things though.
You should start researching those things yourself though, since
running through a whole Rails stack is out of the scope of this
mailing list. Google is your friend.
But since you’re just starting off with Rails, I would advise you to
simply run a Ubuntu Linux virtual machine (or even completely switch
to Linux right away) instead of frustrating yourself with Windows
problems and avoid even more issues with native library gems in the
future.
Hi Peter,
I m running Java VM on my system. Is there any luck with WIndows that i
can expect of…???
I need to deliver a few projects pity quick and thats why i thought RoR
would come handy…
Pls put your helping hands together…
I m running Java VM on my system. Is there any luck with WIndows that i
can expect of…???
Yes, in fact JRuby is a good option on Windows. Download the latest
version of NetBeans, which comes with JRuby, and you should be able to
get a Rails app up and running fairly quickly.
I m running Java VM on my system. Is there any luck with WIndows that i
can expect of…???
Yes, in fact JRuby is a good option on Windows. Download the latest
version of NetBeans, which comes with JRuby, and you should be able to
get a Rails app up and running fairly quickly.
Oh, for goodness’ sakes, not NetBeans! Don’t get the poor guy used to
using an IDE for Rails – it doesn’t need one. Just download JRuby and
have done with it.
A number of Ruby gems like the mysql2 gem are built with extensions
written
in C, which means they need a properly configured compiler and tool
chain on
the computer they’re being installed on; without it the build process
fails
and the gem doesn’t install correctly.
These things are standard on Linux installations of course, but not in
Windows. However the guys at the RubyInstaller project have put
together a
development kit for Windows so that gems with native extensions will
compile. Go here: http://rubyinstaller.org/add-ons/devkit/ for the
project
page and here: Development Kit · oneclick/rubyinstaller Wiki · GitHub
for
the installation instructions.
Once you have the DevKit installed, re-run “bundle install” and
hopefully
the mysql2 gem should now install properly.
@Peter, Mark, Marnem: Thanks guys for the posts
I have kick started my first project.But on windows and that on a
sqlite3 db. I tried hard to get mysql but somehow its not willing to
dance with the rails on Windows platform. But still I would try out my
luck with JRuby on windows and later on if i can survive RoR i will
shift to Linux…
But if any body pokes in the direction of how to make MySQL work with
Rails on windows would be like an angel…
hope to get further guidance from Railers.
Many thanks,
Premanshu
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.