Problems in installing thin on windows 7 - ruby

I am new to ruby. I am trying to install a ruby gem thin. It shows an error in installing the gem. I googled for the error but i could not find a link that addresses my problem.
The error is:
C:\Users\name\Desktop>ruby -v
ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
C:\Users\name\Desktop>gem -v
2.0.3
C:\Users\name\Desktop>gem install thin
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing thin:
ERROR: Failed to build gem native extension.
C:/Ruby200/bin/ruby.exe extconf.rb
checking for main() in -lc... *** 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/bin/ruby
--with-thin_parser-dir
--without-thin_parser-dir
--with-thin_parser-include
--without-thin_parser-include=${thin_parser-dir}/include
--with-thin_parser-lib
--without-thin_parser-lib=${thin_parser-dir}/
--with-clib
--without-clib
C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:430:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:515:in `try_link0'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:530:in `try_link'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:716:in `try_func'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:946:in `block in have_library'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:891:in `block in checking_for'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `block (2 levels) in postpone'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:306:in `open'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:336:in `block in postpone'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:306:in `open'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:332:in `postpone'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:890:in `checking_for'
from C:/Ruby200/lib/ruby/2.0.0/mkmf.rb:941:in `have_library'
from extconf.rb:4:in `<main>'
Gem files will remain installed in C:/Ruby200/lib/ruby/gems/2.0.0/gems/thin-1.6.0 for inspection.
Results logged to C:/Ruby200/lib/ruby/gems/2.0.0/gems/thin-1.6.0/ext/thin_parser/gem_make.out
C:\Users\name\Desktop>
Any help truly appreciated. Thanks.

I resolved the problem by following these steps. Posting this answer as it might be useful for others.
I uninstalled and deleted all the ruby stuff and restarted the machine. Downloaded Ruby 2.0 and Devkit from here http://rubyinstaller.org/downloads/.
Installed ruby and devkit. Install devkit using the instructions given in this link https://github.com/oneclick/rubyinstaller/wiki/Development-Kit.
cd to ruby folder and installed rails, thin gem

Related

Gem::Ext::BuildError: ERROR: Failed to build gem native extension - nio4r

I am trying to install all gems in my gemfile and its dependencies, so just ran the Bundler (bundle or bundle install). It failed while installing nio4r 1.1.1 with native extensions, below is log in gem_make.out.
/opscode/chef/embedded/bin/ruby.exe -r ./siteconf20150924-7480-ocwr34.rb extconf.rb
checking for unistd.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=/opscode/chef/embedded/bin/ruby
/opscode/chef/embedded/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 /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:565:in `try_cpp'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:1038:in `block in have_header'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:889:in `block in checking_for'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:310:in `open'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:888:in `checking_for'
from /opscode/chef/embedded/lib/ruby/2.0.0/mkmf.rb:1037:in `have_header'
from extconf.rb:3:in `'
extconf failed, exit code 1
I can see that the bundler is checking for the unistd.h and failing at that point. I made sure that this header is available within the PATH and also installed the ruby devkit for my version. Doing a gem install nio4r also gives the same error.
try xcode-select --install first.This may be an issue with xcode build system

gem install stopped working after upgrade to OS X 10.10 Yosemite

I upgraded to OS X Yosemite and gem install stopped working.
When I run it, I see this big ugly error:
$ gem install rdiscount
Building native extensions. This could take a while...
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.
ruby -r ./siteconf.rb extconf.rb
checking for random()... *** 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=ruby
--with-rdiscount-dir
--without-rdiscount-dir
--with-rdiscount-include
--without-rdiscount-include=${rdiscount-dir}/include
--with-rdiscount-lib
--without-rdiscount-lib=${rdiscount-dir}/
mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from mkmf.rb:513:in `block in try_link0'
from tmpdir.rb:88:in `mktmpdir'
from mkmf.rb:510:in `try_link0'
from mkmf.rb:534:in `try_link'
from mkmf.rb:720:in `try_func'
from mkmf.rb:1004:in `block in have_func'
from mkmf.rb:895:in `block in checking_for'
from mkmf.rb:340:in `block (2 levels) in postpone'
from mkmf.rb:310:in `open'
from mkmf.rb:340:in `block in postpone'
from mkmf.rb:310:in `open'
from mkmf.rb:336:in `postpone'
from mkmf.rb:894:in `checking_for'
from mkmf.rb:1003:in `have_func'
from extconf.rb:5:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in rdiscount-2.1.7.1 for inspection.
Results logged to /gem_make.out
When you upgrade to Yosemite Xcode command line tools becomes unavailable.
Run this command, and follow the on screen instructions.
$ xcode-select --install
xcode-select: note: install requested for command line developer tools

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. Archlinux

I'm trying to run jekyll locally on my laptop.
I followed the guide of Github to do that, https://help.github.com/articles/using-jekyll-with-pages
Unfortunaly I'm stuck when I have typed
$bundle install
I get the following error:
Fetching gem metadata from https://rubygems.org/.........Failed to load /etc/gemrc due to permissions problem.
Resolving dependencies...
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby extconf.rb
checking for main() in -lc... *** 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=/usr/bin/ruby
--with-redcloth_scan-dir
--without-redcloth_scan-dir
--with-redcloth_scan-include
--without-redcloth_scan-include=${redcloth_scan-dir}/include
--with-redcloth_scan-lib
--without-redcloth_scan-lib=${redcloth_scan-dir}/lib
--with-clib
--without-clib
/usr/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 /usr/lib/ruby/2.1.0/mkmf.rb:541:in `try_link0'
from /usr/lib/ruby/2.1.0/mkmf.rb:556:in `try_link'
from /usr/lib/ruby/2.1.0/mkmf.rb:742:in `try_func'
from /usr/lib/ruby/2.1.0/mkmf.rb:973:in `block in have_library'
from /usr/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
from /usr/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
from /usr/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /usr/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
from /usr/lib/ruby/2.1.0/mkmf.rb:321:in `open'
from /usr/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
from /usr/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
from /usr/lib/ruby/2.1.0/mkmf.rb:968:in `have_library'
from extconf.rb:5:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /tmp/bundler20140903-2231-pkzqqj/RedCloth-4.2.9/gems /RedCloth-4.2.9 for inspection.
Results logged to /tmp/bundler20140903-2231-pkzqqj/RedCloth-4.2.9/extensions/x86_64-linux/2.1.0/RedCloth-4.2.9/gem_make.out
An error occurred while installing RedCloth (4.2.9), and Bundler cannot
continue.
Make sure that `gem install RedCloth -v '4.2.9'` succeeds before bundling.
I tryed to install ruby multiple times but it's not solving my problem. Do you have any hints?
I had this problem on MacOS and it was fixed by agreeing to the Xcode License. I had recently updated Xcode and it turns out that I needed to re-agree to the license in order to use the command line tools successfully.
Just run:
xcodebuild -license
This worked for me:
bundle config build.nokogiri --use-system-libraries
bundle install
brew install qt
then
gem install RedCloth -v '4.2.9'
then
bundle install

Bundle Install Fails on Curb Gem - Mac OS X 10.8.2

When I try to run bundle installthis is the issue I am running into:
Installing curb (0.8.1) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb
checking for curl-config... yes
checking for curlinfo_redirect_time... *** 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=/Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/bin/ruby
--with-curl-dir
--without-curl-dir
--with-curl-include
--without-curl-include=${curl-dir}/include
--with-curl-lib
--without-curl-lib=${curl-dir}/lib
/Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:491:in `block in try_compile'
from /Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:443:in `with_werror'
from /Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:491:in `try_compile'
from extconf.rb:52:in `block in have_constant'
from /Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/dennismonsewicz/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from extconf.rb:44:in `have_constant'
from extconf.rb:62:in `<main>'
I am running ruby 1.9.3p125 with RVM and have re-installed curl (locally) and still am running into the same issue... I have tried everything that I have found on fixing this issue, but can't seem to get the problem to subside. Any one else run across this issue and have successfully fixed it?
When you see this message you need to install the XCode Command Line Tools package:
You have to install development tools first.
These are available from the developer download site.

RedCloth makefile error when trying to run bundle install for Octopress

I've just pulled down Octopress from Git ( github.com/imathis/octopress.git octopress ) to my local machine, but when I try to run bundle install per the instructions, ( http://octopress.org/docs/setup/ ) I get a make error. I'm running version 3.2 of Xcode--do I need to update to 4.x from the Apple Developer site?
I'm also running Ruby 1.9.2p180 per RVM. Do I need to run a more recent version?
Here's the output when I try to run sudo gem install RedCloth:
Building native extensions. This could take a while...
ERROR: Error installing RedCloth:
ERROR: Failed to build gem native extension.
/Users/user/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
checking for main() in -lc... 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/user/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
--with-redcloth_scan-dir
--without-redcloth_scan-dir
--with-redcloth_scan-include
--without-redcloth_scan-include=${redcloth_scan-dir}/include
--with-redcloth_scan-lib
--without-redcloth_scan-lib=${redcloth_scan-dir}/lib
--with-clib
--without-clib
/Users/user/.rvm/rubies/ruby-1.9.2-p180/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 /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:435:in `try_link0'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:440:in `try_link'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:552:in `try_func'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:748:in `block in
have_library'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:693:in `block in
checking_for'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block (2
levels) in postpone'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:280:in `block in
postpone'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:276:in `postpone'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:692:in
`checking_for'
from /Users/user/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/mkmf.rb:743:in
`have_library'
from extconf.rb:5:in `<main>'
Gem files will remain installed in /Users/user/.rvm/gems/ruby-1.9.2-p180/gems/RedCloth-
4.2.8 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-1.9.2-p180/gems/RedCloth-
4.2.8/ext/redcloth_scan/gem_make.out
You should try running Ruby 1.9.2-p290.
rvm install 1.9.2 && rvm use 1.9.2
this fixed the error for me..
sudo apt-get install ruby1.9.1-full
sudo update-alternatives --config ruby
(it seems the error is caused when some of the ruby1.9.1-dev build files/config are missing)

Resources