Im new to ruby and rails. I've set up ruby 2 on rails 4 successfully (On windows 7). I cloned a ruby on rails based git project (thingspeak - https://github.com/iobridge/thingspeak/blob/master/README.textile). Using the command line I went into the project directory and ran "bundle install". A few bundles got downloaded and installed and then I got the following error -
::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension
.
c:/row/Ruby200/bin/ruby.exe extconf.rb
checking for CLOCK_MONOTONIC in time.h... yes
checking for clockid_t in time.h... yes
checking for clock_gettime() in -lrt... no
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll() in poll.h... no
checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... no
getaddrinfo required
*** 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:/row/Ruby200/bin/ruby
--with-rtlib
--without-rtlib
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib
Gem files will remain installed in c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/kgio-
2.8.1 for inspection.
Results logged to c:/row/Ruby200/lib/ruby/gems/2.0.0/gems/kgio-2.8.1/ext/kgio/ge
m_make.out
An error occurred while installing kgio (2.8.1), and Bundler cannot continue.
Make sure that `gem install kgio -v '2.8.1'` succeeds before bundling.
Any ideas on what it means and how to fix it?
The kgio gem which fails to compile here does not work on Windows. It could work if you comment the respective line in the Gemfile but could fail in various other places.
Generally, the Rails app you want to install doesn't seem to be tested on Windows at all, so you might instead want to use a better supported OS to install it. The README mentions Ubuntu here.
Related
I'm following this Go Rails tutorial and I'm running into trouble when I reach the step to install rails. I'm calling
sudo gem install rails -v 5.0.1
in the terminal and getting this error:
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.7.0.1/ext/nokogiri
/usr/local/opt/ruby/bin/ruby -r ./siteconf20170302-50105-1af2foa.rb extconf.rb
checking if the C compiler accepts ... yes
checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future... no
Building nokogiri using packaged libraries.
Using mini_portile version 2.1.0
checking for iconv.h... yes
checking for gzdopen() in -lz... no
zlib is missing; necessary for building libxml2
*** 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
--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=/usr/local/Cellar/ruby/2.4.0/bin/$(RUBY_BASE_NAME)
--help
--clean
--use-system-libraries
--enable-static
--disable-static
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--enable-cross-build
--disable-cross-build
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0/nokogiri-1.7.0.1/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /usr/local/lib/ruby/gems/2.4.0/gems/nokogiri-1.7.0.1 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-16/2.4.0/nokogiri-1.7.0.1/gem_make.out
I'm not really sure what to make of this. I've tried reinstalling uninstalling and reinstalling zlib but it didn't seem to change anything. I'm on OS X Sierra version 10.12.3 by the way.
Solved by this thread using
sudo gem install rails -- --use-system-libraries --with-xml=/usr/local/Cellar/libxml2/
I am installing gem rmagick in Ubuntu 14.04 OS but I am getting error as,
Building native extensions. This could take a while...
ERROR: Error installing rmagick:
ERROR: Failed to build gem native extension.
/home/jignesh/.rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20150317-9073-18x8ncb.rb extconf.rb
checking for Ruby version >= 1.8.5... yes
checking for gcc... yes
checking for Magick-config... yes
checking for ImageMagick version >= 6.4.9... yes
checking for stdint.h... yes
checking for sys/types.h... yes
checking for wand/MagickWand.h... no
Can't install RMagick 2.13.4. Can't find MagickWand.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=/home/jignesh/.rvm/rubies/ruby-2.1.5/bin/ruby
extconf failed, exit code 1
I have tried so many solutions provided on Stackoverflow as well as on other sites but no one worked for me.
So please any one provide me solution.
Thanks in advance.
You should install magickwand package to fix this problem:
sudo apt-get install libmagickwand-dev
I am unable to install Unicorn on localhost (OS -- Windows 8).
>gem install unicorn
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing unicorn:
ERROR: Failed to build gem native extension.
E:/software/Ruby200-x64/bin/ruby.exe extconf.rb
checking for CLOCK_MONOTONIC in time.h... yes
checking for clockid_t in time.h... yes
checking for clock_gettime() in -lrt... no
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll() in poll.h... no
checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... no
getaddrinfo required
*** 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=E:/software/Ruby200-x64/bin/ruby
--with-rtlib
--without-rtlib
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib
Gem files will remain installed in E:/software/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kgio-2.9.2 for inspection.
Results logged to E:/software/Ruby200-x64/lib/ruby/gems/2.0.0/gems/kgio-2.9.2/ext/kgio/gem_make.out
Why? What am I doing wrong? How can I fix it?
I'm using Ruby on Rails 4.1.4 btw.
Thanks in advance.
Unicorn does not have native Windows support.
I've downloaded a rails open source webapp , and while i was starting it using :
C:\Users\admin\Downloads\iCare\icare-develop>rails server
←[31mCould not find kgio-2.8.0 in any of the sources←[0m
←[33mRun `bundle install` to install missing gems.←[0m
i tried to fix this error using:
cmd:>gem install kgio -v '2.8.0'
i got the error:
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing kgio:
ERROR: Failed to build gem native extension.C:/Ruby193/bin/ruby.exe extconf.rb
checking for CLOCK_MONOTONIC in time.h... no
checking for CLOCK_MONOTONIC() in time.h... no
checking for clockid_t in time.h... no
checking for clock_gettime() in -lrt... no
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll() in poll.h... no
checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... no
getaddrinfo required
*** 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.
and
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:/Ruby193/bin/ruby
--with-rtlib
--without-rtlib
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib
and
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/kgio-2.8.
0 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/kgio-2.8.0/ext/kgio/gem_ma
ke.out
i did type:bundle install after, but nothing happened..
kgio is only for *nix system.
the kgio gem page:
kgio 2.8.0 kgio provides non-blocking I/O methods for Ruby without
raising exceptions on EAGAIN and EINPROGRESS. It is intended for use
with the Unicorn and Rainbows! Rack servers, but may be used by other
applications (that run on Unix-like platforms).
Try this
platforms :ruby do # linux
gem 'unicorn'
end
platforms :mswin do
# gems specific to windows
end
Source:
Develop on windows, run unicorn in production on heroku
I think you're using windows operating system , so only thing you need to get ride of this error is to comment in or remove the gem 'unicorn' in you gem file as this is only for linux systems
I can't seem to install kgio with my app, every time I do bundle install. I get this error ! Can anyone help me? I have tried re bundling like 5 times already.
C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
checking for CLOCK_MONOTONIC in time.h... no
checking for CLOCK_MONOTONIC() in time.h... no
checking for clockid_t in time.h... no
checking for clock_gettime() in -lrt... no
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for poll() in poll.h... no
checking for getaddrinfo() in sys/types.h,sys/socket.h,netdb.h... no
getaddrinfo required
*** 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/Ruby1.9.3/bin/ruby
--with-rtlib
--without-rtlib
--with-nsllib
--without-nsllib
--with-socketlib
--without-socketlib
Actually, the answer is that you can't use kgio with windows. I spent 3 hours sweating through the other answer here before finding that out. Kgio needs a unix-like environment according to it's developer.
You are probably missing required libraries.
Also from RubyInstaller Wiki
This failure is due to the native gem compile/install process using a version of libiconv-2.dll other than the one integrated into the DevKit due to how Windows searches for DLLs
This can be worked around by searching your computer for the file libiconv-2.dll and renaming, deleting, or otherwise moving any found instances out of the way and re-running the native gem install process or in your case Bundle Install
It is recommended that if you don’t know why or what put the libiconv-2.dll file in the directory in which you found it, that you move it back after you compile whatever gems you need. This will possibly prevent other applications from breaking.
EDIT:
The kgio gem only builds and runs on Unix like systems (http://bogomips.org/kgio/) It uses functions which are not natively available on Windows.
If you are trying to use Unicorn, then you just need to replace the webserver.
Give Thin a try. Add the following lines to your Gemfile:
gem 'thin'