I am having problems in order to debug an app using ruby-debug with RadRails.
I try to install the gem with gem install ruby-debug19 -as I am using Ruby 1.9.1-p249 but I get the following error:
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:>gem install ruby-debug19
Building native extensions. This could take a while...
ERROR: Error installing ruby-debug19:
ERROR: Failed to build gem native extension.
C:/Ruby191/bin/ruby.exe extconf.rb
checking for vm_core.h... * 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:/Ruby191/bin/ruby
--with-ruby-dir
--without-ruby-dir
--with-ruby-include
--without-ruby-include=${ruby-dir}/include
--with-ruby-lib
--without-ruby-lib=${ruby-dir}/lib
C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:364:in try_do': The complier failed
to genera
te an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:433:intry_cpp'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:811:in block in
have_header'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:670:inblock in
checking_for'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:276:in block (2 levels)
in postp
one'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:250:inopen'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:276:in block in
postpone'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:250:inopen'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:272:in postpone'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:669:inchecking_for'
from C:/Ruby191/lib/ruby/1.9.1/mkmf.rb:810:in have_header'
from extconf.rb:15:inblock in '
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.4/lib/ruby
_core_source.rb:18:in call'
from
C:/Ruby191/lib/ruby/gems/1.9.1/gems/ruby_core_source-0.1.4/lib/ruby
_core_source.rb:18:increate_makefile_with_core'
from extconf.rb:20:in `'
Gem files will remain installed in
C:/Ruby191/lib/ruby/gems/1.9.1/gems/linecache
19-0.5.11 for inspection.
Results logged to
C:/Ruby191/lib/ruby/gems/1.9.1/gems/linecache19-0.5.11/ext/tra
ce_nums/gem_make.out
C:>
Thanks in advance!
Just guessing... it didn't find vm_core.h, so you have to set that path using -I<path>.
If I may suggest you something for less pain, use Virtualbox + ubuntu + rvm.
Just installed RubyInstaller 1.9.2 and worked
Related
I am a newcomer to Fedora and Rails and do not know how to solve this problem. Here is the error message:
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /usr/local/share/gems/gems/nokogiri-1.6.7.2/ext/nokogiri
/usr/bin/ruby -r ./siteconf20160209-8980-yntffh.rb extconf.rb
checking if the C compiler accepts ... *** 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}/lib64
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/bin/$(RUBY_BASE_NAME)
--help
--clean
/usr/share/ruby/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /usr/share/ruby/mkmf.rb:571:in `block in try_compile'
from /usr/share/ruby/mkmf.rb:522:in `with_werror'
from /usr/share/ruby/mkmf.rb:571:in `try_compile'
from extconf.rb:80:in `nokogiri_try_compile'
from extconf.rb:87:in `block in add_cflags'
from /usr/share/ruby/mkmf.rb:619:in `with_cflags'
from extconf.rb:86:in `add_cflags'
from extconf.rb:336:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib64/gems/ruby/nokogiri-1.6.7.2/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/share/gems/gems/nokogiri-1.6.7.2 for inspection.
Results logged to /usr/local/lib64/gems/ruby/nokogiri-1.6.7.2/gem_make.out
The key message here is
You have to install development tools first.
which should be installed with
dnf install #development-tools
See "What is the Fedora equivalent of the Debian build-essential package?" for more information.
I am trying to install the stripe gem and I'm getting this error
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/bin/ruby -r ./siteconf20151005-1267-af6sn6.rb extconf.rb checking for main() in
-lstdc++... * 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=/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/bin/ruby
--with-static-libstdc++ --without-static-libstdc++ --with-stdc++lib
--without-stdc++lib
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:434:in
try_do': The compiler failed to generate an executable file.
(RuntimeError) You have to install development tools first. from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:519:in
try_link0' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:534:in
try_link' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:714:in
try_func' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:944:in
block in have_library' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:889:in
block in checking_for' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:340:in
block (2 levels) in postpone' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:310:in
open' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:340:in
block in postpone' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:310:in
open' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:336:in
postpone' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:888:in
checking_for' from
/Users/Fysh/.rvm/rubies/ruby-2.0.0-p643/lib/ruby/2.0.0/mkmf.rb:939:in
have_library' from extconf.rb:6:in'
extconf failed, exit code 1
Gem files will remain installed in
/Users/Fysh/.rvm/gems/ruby-2.0.0-p643/gems/unf_ext-0.0.7.1 for
inspection. Results logged to
/Users/Fysh/.rvm/gems/ruby-2.0.0-p643/extensions/x86_64-darwin-14/2.0.0-static/unf_ext-0.0.7.1/gem_make.out
An error occurred while installing unf_ext (0.0.7.1), and Bundler
cannot continue. Make sure that gem install unf_ext -v '0.0.7.1'
succeeds before bundling.
Solved had an xcode update after I updated it worked.
I know there are many questions about this error but I read several tutorials and SO discussions without coming to a solution.
I'm trying to install rmagick (I want to install Spree ecommerce for Ruby on Rails which requires ImageMagick and rmagick).
I'm working on Windows 7 (64 bit), Ruby version is: 2.1.5, Rails version is 4.2.1. and I downloaded and installed (in C:\ImageMagick) ImageMagick-6.9.1-2-Q16-x64-dll.exe and I also installed Dev-Kit.
I followed the steps that Sumit Munot suggested here ImageMagick Install Windows but when I follow the step 6 I get this errors.
C:\Sites>gem install rmagick
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... *** 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:/RailsInstaller/Ruby2.1.0/bin/ruby
C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler
failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:1067:in `block i
n have_header'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:918:in `block in
checking_for'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:351:in `block (2
levels) in postpone'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:351:in `block in
postpone'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:347:in `postpone
'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:917:in `checking
_for'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:1066:in `have_he
ader'
from extconf.rb:37:in `configure_headers'
from extconf.rb:17:in `initialize'
from extconf.rb:474:in `new'
from extconf.rb:474:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1
.0/gems/rmagick-2.15.0 for inspection.
Results logged to C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86
-mingw32/2.1.0/rmagick-2.15.0/gem_make.out
C:\Sites>gem install rmagick
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby2.1.0/bin/ruby.exe extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for stdint.h... *** 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:/RailsInstaller/Ruby2.1.0/bin/ruby
C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler
failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:587:in `try_cpp'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:1067:in `block i
n have_header'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:918:in `block in
checking_for'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:351:in `block (2
levels) in postpone'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:351:in `block in
postpone'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:347:in `postpone
'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:917:in `checking
_for'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/mkmf.rb:1066:in `have_he
ader'
from extconf.rb:37:in `configure_headers'
from extconf.rb:17:in `initialize'
from extconf.rb:474:in `new'
from extconf.rb:474:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1
.0/gems/rmagick-2.15.0 for inspection.
Results logged to C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/extensions/x86
-mingw32/2.1.0/rmagick-2.15.0/gem_make.out
This is my path: C:\RailsInstaller\Git\cmd;C:\RailsInstaller\Ruby2.1.0\bin;C:\Ruby21\bin;
Do I have to add something to the path?
Yeah, had the same trouble and gave it a second shot.
Remove your current ImageMagic folder and rmagick gem
Install ImageMagick-6.7.9-3-Q16-windows-dll.exe from here and ImageMagick-6.7.9-2-Q8-windows-static.exe in the same folder (these worked while the most recent ones don't)
in your console window set path=d:\ImageMagick;%path%
gem install rmagick -- '--with-opt-dir="d:\ImageMagick"'
I installed ImageMagick obviously in d:\ImageMagick, so adapt for your situation.
This worked for my Ruby 1.9.3 under Windows 7, success !
Set %DEVKIT_HOME%\bin in your %PATH% in the System Variables:
I'm trying to install Ruby on Rails, but I keep getting this error message:
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
I don't know what to do, I've tried searching online for answers, such as installing command line tools, gcc, and others I can't remember, but to no effect. I often get errors doing things that others have said are suppose to resolve the problem too.
Here is the entire error message:
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb
checking if the C compiler accepts ... *** 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=/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
--help
--clean
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `block in try_compile'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:500:in `with_werror'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:549:in `try_compile'
from extconf.rb:80:in `nokogiri_try_compile'
from extconf.rb:87:in `block in add_cflags'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/mkmf.rb:599:in `with_cflags'
from extconf.rb:86:in `add_cflags'
from extconf.rb:337:in `<main>'
Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2 for inspection.
Results logged to /Library/Ruby/Gems/2.0.0/gems/nokogiri-1.6.6.2/ext/nokogiri/gem_make.out
i wanted to know why i am getting this error, my Devkit is good to go as far as i know, all other gems are being installed correctly after bundle install and update except the JSON gem. What is the problem?
This is how the error looks:
Installing json (1.5.1) with native extensions c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/in
staller.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
c:/Ruby192/bin/ruby.exe extconf.rb
checking for ruby/re.h... *** 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:/Ruby192/bin/ruby
c:/Ruby192/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:/Ruby192/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp'
from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:834:in `block in have_header'
from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for'
from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone'
from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from c:/Ruby192/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone'
Thank you!
Thanks to Joe Cannatti, he helped me figure out the issue. I just reinstalled Devkit and overwrite all files even it was the same version (DevKit-tdm-32-4.5.1-20101214-1400-sfx.exe), must've had issues on first extraction and integration. Which also fixed this lame "program can't start because of msvcrt-ruby18.dll is missing from your computer" error too.
Good luck to others!
I had to use RVM to remove ruby, rvm remove 1.9.2, and reinstalled 1.9.2, now installing gems with native extensions is working. Note: I also made sure I had command line tools installed.
Source: https://github.com/flori/json/issues/78#issuecomment-1499920