I tried to install the puma because when I tried bundle, it said I need to install the puma, but when I tried to install it, I got this error
gem install puma -v '3.12.6' --source 'https://rubygems.org/'
Temporarily enhancing PATH to include DevKit...
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.
current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-3.12.6/ext/puma_http11
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210202-20756-30084d.rb extconf.rb
checking for BIO_read() in -lcrypto... *** 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:/Ruby26-x64/bin/$(RUBY_BASE_NAME)
--with-puma_http11-dir
--without-puma_http11-dir
--with-puma_http11-include
--without-puma_http11-include=${puma_http11-dir}/include
--with-puma_http11-lib
--without-puma_http11-lib=${puma_http11-dir}/lib
--with-openssl-dir
--without-openssl-dir
--with-openssl-include
--without-openssl-include=${openssl-dir}/include
--with-openssl-lib
--without-openssl-lib=${openssl-dir}/lib
--with-cryptolib
--without-cryptolib
C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:552:in `try_link0'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:570:in `try_link'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:782:in `try_func'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:1016:in `block in have_library'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:959:in `block in checking_for'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:361:in `block (2 levels) in postpone'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:361:in `block in postpone'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:331:in `open'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:357:in `postpone'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:958:in `checking_for'
from C:/Ruby26-x64/lib/ruby/2.6.0/mkmf.rb:1011:in `have_library'
from extconf.rb:8:in `block in <main>'
from extconf.rb:8:in `each'
from extconf.rb:8:in `find'
from extconf.rb:8:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/puma-3.12.6/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-3.12.6 for inspection.
Results logged to C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/puma-3.12.6/gem_make.out
This is the mkmg.log file. I thought it is because I didn't' download the devkit so I downloaded the dev kit and I did ruby dk.rb init, dk.rb install --force but it doesn't work.
"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby26-x64/include/ruby-2.6.0/x64-mingw32 -IC:/Ruby26-x64/include/ruby-2.6.0/ruby/backward -IC:/Ruby26-x64/include/ruby-2.6.0 -I. -D_FORTIFY_SOURCE=2 -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64 -O3 -fno-fast-math conftest.c -L. -LC:/Ruby26-x64/lib -L. -pipe -s -lx64-msvcrt-ruby260 -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7: return 0;
8: }
/* end */
My gem env outputs are
RubyGems Environment:
- RUBYGEMS VERSION: 3.2.7
- RUBY VERSION: 2.6.3 (2019-04-16 patchlevel 62) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/Ruby26-x64/lib/ruby/gems/2.6.0
- USER INSTALLATION DIRECTORY: C:/Users/Kim/.gem/ruby/2.6.0
- RUBY EXECUTABLE: C:/Ruby26-x64/bin/ruby.exe
- GIT EXECUTABLE: C:\Program Files\Git\cmd/git.EXE
- EXECUTABLE DIRECTORY: C:/Ruby26-x64/bin
- SPEC CACHE DIRECTORY: C:/Users/Kim/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
- RUBYGEMS PLATFORMS:
- ruby
- x64-mingw32
- GEM PATHS:
- C:/Ruby26-x64/lib/ruby/gems/2.6.0
- C:/Users/Kim/.gem/ruby/2.6.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- c:\program files\graphicsmagick-1.3.35-q16
- C:\Program Files\Microsoft MPI\Bin\
- C:\Program Files (x86)\Common Files\Oracle\Java\javapath
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\Wbem
- C:\Windows\System32\WindowsPowerShell\v1.0\
- C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
- C:\Program Files\Intel\WiFi\bin\
- C:\Program Files\Common Files\Intel\WirelessCommon\
- C:\WINDOWS\system32
- C:\WINDOWS
- C:\WINDOWS\System32\Wbem
- C:\WINDOWS\System32\WindowsPowerShell\v1.0\
- C:\WINDOWS\System32\OpenSSH\
- C:\Program Files\Java\jdk-10.0.2\bin
- C:\Users\Kim\Desktop\mysql-8.0.16-winx64\mysql-8.0.16-winx64\bin
- C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR
- C:\WINDOWS\system32
- C:\WINDOWS
- C:\WINDOWS\System32\Wbem
- C:\WINDOWS\System32\WindowsPowerShell\v1.0\
- C:\WINDOWS\System32\OpenSSH\
- C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\
- C:\Program Files (x86)\Microsoft SQL Server\150\Tools\Binn\
- C:\Program Files\Microsoft SQL Server\150\Tools\Binn\
- C:\Program Files\Microsoft SQL Server\150\DTS\Binn\
- C:\Program Files\Microsoft SQL Server\130\Tools\Binn\
- C:\Program Files (x86)\Brackets\command
- C:\Program Files\dotnet\
- C:\Program Files\Git\cmd
- C:\Program Files (x86)\dotnet\
- C:\Program Files\CMake\bin
- C:\Program Files\PostgreSQL\13\lib
- C:\Program Files\PostgreSQL\13\bin
- C:\Program Files\GraphicsMagick-1.3.35-Q16
- C:\MinGW\bin
- C:\Ruby26-x64\devkit\bin
- C:\msys64\mingw64\bin
- C:\msys64\mingw64\lib
- C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin
- C:\Ruby26-x64\devkit\mingw\bin
- C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0
- C:\Program Files (x86)\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\lib\gcc\i686-w64-mingw32\8.1.0\include\c++\tr1
- C:\Ruby26-x64\bin
- C:\Users\Kim\AppData\Local\Programs\Microsoft VS Code\bin
- C:\Users\Kim\AppData\Local\Microsoft\WindowsApps
- C:\Users\\.dotnet\tools
- C:\Users\Kim\AppData\Local\GitHubDesktop\bin
- C:\Program Files (x86)\GitHub CLI\
Related
When trying to install a gem i receive an error:
No such device or address # rb_file_s_stat - Z:/
when checking the gem environment variables i get the following return:
C:\Program Files (x86)\SOME_FOLDER\Ruby\bin>gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.6.6
- RUBY VERSION: 2.3.1 (2016-04-26 patchlevel 112) [x64-mingw32]
- INSTALLATION DIRECTORY: C:/Program Files (x86)/SOME_FOLDER/Ruby/lib/ruby/gems/2.3.0
- USER INSTALLATION DIRECTORY: Z:/.gem/ruby/2.3.0
- RUBY EXECUTABLE: "C:/Program Files (x86)/SOME_FOLDER/Ruby/bin/ruby.exe"
- EXECUTABLE DIRECTORY: C:/Program Files (x86)/SOME_FOLDER/Ruby/bin
- SPEC CACHE DIRECTORY: Z:/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
- RUBYGEMS PLATFORMS:
- ruby
- x64-mingw32
- GEM PATHS:
- C:/Program Files (x86)/SOME_FOLDER/Ruby/lib/ruby/gems/2.3.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- C:\Program Files (x86)\Common Files\Oracle\Java\javapath
- C:\Windows\system32
- C:\Windows
- C:\Windows\System32\Wbem
- C:\Windows\System32\WindowsPowerShell\v1.0\
- C:\Windows\System32\OpenSSH\
- C:\Program Files\TortoiseSVN\bin
- C:\Users\rekenmt\AppData\Local\Microsoft\WindowsApps
the problem is clear: USER INSTALLATION DIRECTORY and SPEC CACHE DIRECTORY are not valid paths (Z:/ disk does not exist.) the question therefore is:
how do i change those variables to point to another path
Thank you in advance
I had the same issue and running this in the command line fixed it for me.
SET HOME=%USERPROFILE%
Source here: https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#gem-commands-fails-if-home-maps-to-a-network-drive
I'm trying to install and use Nokigoro for XML parsing (if there is an alternative parser that doesn't result in mindless head hitting of wall - I'm happy to check it out)
I'm running this via a recipe on the chef client, in my recipe I have:
# include_recipe 'ohai'
chef_gem 'nokogiri'
require 'nokogiri'
which is as far as it gets really.
Running this as my run list results in the following error:
Starting Chef Client, version 12.12.15
[2017-03-31T14:07:36+00:00] WARN: Run List override has been provided.
[2017-03-31T14:07:36+00:00] WARN: Original Run List: []
[2017-03-31T14:07:36+00:00] WARN: Overridden Run List: [recipe[steve-solr]]
resolving cookbooks for run list: ["steve-solr"]
Synchronizing Cookbooks:
- steve-solr (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Recipe: steve-solr::default
* chef_gem[nokogiri] action install
================================================================================
Error executing action `install` on resource 'chef_gem[nokogiri]'
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '1'
---- Begin output of /opt/chef/embedded/bin/gem install nokogiri -q --no-rdoc --no-ri -v "1.7.1" ----
STDOUT: Building native extensions. This could take a while...
STDERR: ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/nokogiri-1.7.1/ext/nokogiri
/opt/chef/embedded/bin/ruby -r ./siteconf20170331-19864-1d63c49.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
--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=/opt/chef/embedded/bin/ruby
--help
--clean
/opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:582:in `block in try_compile'
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:533:in `with_werror'
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:582:in `try_compile'
from extconf.rb:138:in `nokogiri_try_compile'
from extconf.rb:162:in `block in add_cflags'
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:630:in `with_cflags'
from extconf.rb:161:in `add_cflags'
from extconf.rb:406:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/opt/chef/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.7.1/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/nokogiri-1.7.1 for inspection.
Results logged to /opt/chef/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.7.1/gem_make.out
---- End output of /opt/chef/embedded/bin/gem install nokogiri -q --no-rdoc --no-ri -v "1.7.1" ----
Ran /opt/chef/embedded/bin/gem install nokogiri -q --no-rdoc --no-ri -v "1.7.1" returned 1
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/steve-solr/recipes/default.rb:8:in `from_file'
Resource Declaration:
---------------------
# In /var/chef/cache/cookbooks/steve-solr/recipes/default.rb
8: chef_gem 'nokogiri'
9: require 'nokogiri'
Compiled Resource:
------------------
# Declared in /var/chef/cache/cookbooks/steve-solr/recipes/default.rb:8:in `from_file'
chef_gem("nokogiri") do
package_name "nokogiri"
action [:install]
retries 0
retry_delay 2
default_guard_interpreter :default
declared_type :chef_gem
cookbook_name "steve-solr"
recipe_name "default"
gem_binary "/opt/chef/embedded/bin/gem"
end
Platform:
---------
x86_64-linux
================================================================================
Recipe Compile Error in /var/chef/cache/cookbooks/steve-solr/recipes/default.rb
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
chef_gem[nokogiri] (steve-solr::default line 8) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/chef/embedded/bin/gem install nokogiri -q --no-rdoc --no-ri -v "1.7.1" ----
STDOUT: Building native extensions. This could take a while...
STDERR: ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/nokogiri-1.7.1/ext/nokogiri
/opt/chef/embedded/bin/ruby -r ./siteconf20170331-19864-1d63c49.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
--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=/opt/chef/embedded/bin/ruby
--help
--clean
/opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:582:in `block in try_compile'
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:533:in `with_werror'
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:582:in `try_compile'
from extconf.rb:138:in `nokogiri_try_compile'
from extconf.rb:162:in `block in add_cflags'
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:630:in `with_cflags'
from extconf.rb:161:in `add_cflags'
from extconf.rb:406:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/opt/chef/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.7.1/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/nokogiri-1.7.1 for inspection.
Results logged to /opt/chef/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.7.1/gem_make.out
---- End output of /opt/chef/embedded/bin/gem install nokogiri -q --no-rdoc --no-ri -v "1.7.1" ----
Ran /opt/chef/embedded/bin/gem install nokogiri -q --no-rdoc --no-ri -v "1.7.1" returned 1
Cookbook Trace:
---------------
/var/chef/cache/cookbooks/steve-solr/recipes/default.rb:8:in `from_file'
Relevant File Content:
----------------------
/var/chef/cache/cookbooks/steve-solr/recipes/default.rb:
1: #
2: # Cookbook Name:: steve-solr
3: # Recipe:: default
4: #
5: # Copyright (c) 2017 The Authors, All Rights Reserved.
6: # include_recipe 'aws'
7: # include_recipe 'ohai'
8>> chef_gem 'nokogiri'
9: require 'nokogiri'
10:
11: class SolrObject
12: attr_reader :coreName
13: def initialize(name)
14: #coreName = name
15: end
16:
17: def coreName
Platform:
---------
x86_64-linux
Running handlers:
[2017-03-31T14:07:38+00:00] ERROR: Running exception handlers
Running handlers complete
[2017-03-31T14:07:38+00:00] ERROR: Exception handlers complete
Chef Client failed. 0 resources updated in 02 seconds
[2017-03-31T14:07:38+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2017-03-31T14:07:38+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2017-03-31T14:07:38+00:00] ERROR: chef_gem[nokogiri] (steve-solr::default line 8) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of /opt/chef/embedded/bin/gem install nokogiri -q --no-rdoc --no-ri -v "1.7.1" ----
STDOUT: Building native extensions. This could take a while...
STDERR: ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
current directory: /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/nokogiri-1.7.1/ext/nokogiri
/opt/chef/embedded/bin/ruby -r ./siteconf20170331-19864-1d63c49.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
--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=/opt/chef/embedded/bin/ruby
--help
--clean
/opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:467:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:582:in `block in try_compile'
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:533:in `with_werror'
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:582:in `try_compile'
from extconf.rb:138:in `nokogiri_try_compile'
from extconf.rb:162:in `block in add_cflags'
from /opt/chef/embedded/lib/ruby/2.1.0/mkmf.rb:630:in `with_cflags'
from extconf.rb:161:in `add_cflags'
from extconf.rb:406:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/opt/chef/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.7.1/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/2.1.0/gems/nokogiri-1.7.1 for inspection.
Results logged to /opt/chef/embedded/lib/ruby/gems/2.1.0/extensions/x86_64-linux/2.1.0/nokogiri-1.7.1/gem_make.out
---- End output of /opt/chef/embedded/bin/gem install nokogiri -q --no-rdoc --no-ri -v "1.7.1" ----
Ran /opt/chef/embedded/bin/gem install nokogiri -q --no-rdoc --no-ri -v "1.7.1" returned 1
[2017-03-31T14:07:38+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
with this being in my error file:
"gcc -o conftest -I/opt/chef/embedded/include/ruby-2.1.0/x86_64-linux -I/opt/chef/embedded/include/ruby-2.1.0/$
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
any help or suggestions on fixing would be fantastic, thanks.
Just remove the chef_gem entirely. We bundle nokogiri with the Chef installer so you don't have to install or compile it unless you specifically need the latest version for some reason.
I'm trying to add http://rubygems.org/ in my sources because I can't use 'gem install NAME' (this error : Could not find a valid gem 'dashing' (>= 0) in any repository).
So, I did this command : gem sources -a http://rubygems.org/
the result : ERROR: While executing gem ... (Gem::OperationNotSupportedError)
Not connected to a tty and no default specified
I give you my ENV :
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.5.1
- RUBY VERSION: 2.2.4 (2015-12-16 patchlevel 230) [i386-mingw32]
- INSTALLATION DIRECTORY: C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0
- RUBY EXECUTABLE: C:/RailsInstaller/Ruby2.2.0/bin/ruby.exe
- EXECUTABLE DIRECTORY: C:/RailsInstaller/Ruby2.2.0/bin
- SPEC CACHE DIRECTORY: C:/Users/mramart/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0
- C:/Users/mramart/.gem/ruby/2.2.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- :sources => []
- REMOTE SOURCES:
- SHELL PATH:
- C:\Users\mramart\bin
- C:\Program Files (x86)\Git\mingw32\bin
- C:\Program Files (x86)\Git\usr\local\bin
- C:\Program Files (x86)\Git\usr\bin
- C:\Program Files (x86)\Git\usr\bin
- C:\Program Files (x86)\Git\mingw32\bin
- C:\Program Files (x86)\Git\usr\bin
- C:\Users\mramart\bin
- C:\RailsInstaller\Git\cmd
- C:\RailsInstaller\Ruby2.2.0\bin
- C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common
- C:\Tcl\bin
- C:\ProgramData\Oracle\Java\javapath
- C:\WINDOWS\system32
- C:\WINDOWS
- C:\WINDOWS\System32\Wbem
- C:\WINDOWS\System32\WindowsPowerShell\v1.0
- C:\WINDOWS\System32\WindowsPowerShell\v1.0
- C:\Program Files (x86)\Lenovo\Access Connections
- C:\Program Files\nodejs
- C:\Program Files\Java\jdk1.7.0_79\bin
- C:\Program Files (x86)\Heroku\bin
- C:\Program Files (x86)\git\cmd
- C:\Program Files\TortoiseSVN\bin
- C:\Program Files\PostgreSQL\9.5\bin
- C:\Program Files (x86)\scala\bin
- D:\gatling-charts-highcharts-bundle-2.1.7\bin
- C:\Program Files (x86)\sbt\bin
- %USERPROFILE%\.dnx\bin
- C:\Program Files\Microsoft DNX\Dnvm
- C:\Program Files\Microsoft SQL Server\130\Tools\Binn
- C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit
- C:\Users\mramart\AppData\Roaming\npm
- C:\Program Files\Java\jdk1.8.0_73\bin
- C:\apache-maven-3.0.5\bin
- C:\Program Files\PostgreSQL\9.5\bin
- C:\Program Files\MongoDB\Server\3.2\bin
- D:\liquid
- C:\Users\mramart\AppData\Local\atom\bin
- C:\Program Files (x86)\Git\usr\bin\vendor_perl
- C:\Program Files (x86)\Git\usr\bin\core_perl
None sources executing : gem sources
In such cases, I directly make changes to my Gem Config file. Here is an updated version of ~/.gemrc:
---
:backtrace: false
:bulk_threshold: 1000
:sources:
- http://rubygems.org
:update_sources: true
:verbose: true
Here's how to verify:
$ gem sources
http://rubygems.org/
I'm attempting to install the dandelion gem on on my Windows machine, but it keeps failing:
C:\Users\William>gem install dandelion --platform=ruby
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing dandelion:
ERROR: Failed to build gem native extension.
C:/Ruby22/bin/ruby.exe -r ./siteconf20150623-7568-1ikffjg.rb extconf.rb
checking for gmake... no
checking for make... yes
checking for cmake... yes
checking for pkg-config... yes
-- cmake .. -DBUILD_CLAR=OFF -DTHREADSAFE=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_
FLAGS=-fPIC -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "Unix Makefiles"
-- C:\DevKit\bin/make.exe
checking for main() in -lgit2... *** 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:/Ruby22/bin/$(RUBY_BASE_NAME)
--use-system-libraries
--with-git2-dir
--without-git2-dir
--with-git2-include
--without-git2-include=${git2-dir}/include
--with-git2-lib
--without-git2-lib=${git2-dir}/lib
--with-git2lib
--without-git2lib
C:/Ruby22/lib/ruby/2.2.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:/Ruby22/lib/ruby/2.2.0/mkmf.rb:541:in `try_link0'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:556:in `try_link'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:735:in `try_func'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:966:in `block in have_library'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:911:in `block in checking_for'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:351:in `block (2 levels) in postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:351:in `block in postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:321:in `open'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:347:in `postpone'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:910:in `checking_for'
from C:/Ruby22/lib/ruby/2.2.0/mkmf.rb:961:in `have_library'
from extconf.rb:89:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in C:/Ruby22/lib/ruby/gems/2.2.0/gems/rugged-0.2
2.1b1 for inspection.
Results logged to C:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/rug
ged-0.22.1b1/gem_make.out
The error that states "you have to install development tools first" is a head-scratcher. I have already installed DevKit.
Any ideas how to solve this error?
This is a fun one. I'm going to take a wild guess and say that you have a version of libgit2 located in C:/Program Files (x86)/libgit2/lib and that folder is somehow in your Path or possible some other environment variable.
The fix is to take that folder out of what environment variable that it could be in. That should let rugged build correctly.
The Problem
When gcc is trying to test for the libgit2 library it sees it could possibly be in C:/Program Files (x86)/libgit2/lib and uses -LC:/Program Files (x86)/libgit2/lib.
The problem is that it isn't properly escaped, which leads to
gcc: error: Files: No such file or directory
gcc: error: (x86)/libgit2/lib: No such file or directory
This is actually the same reason why Ruby can't be installed in folders with spaces.
As a side note: I'd like to point out that in addition to the regular DevKit you also have cmake and pkg-config somewhere installed and in your Path
Generally installation Ruby environment on Windows is BAD and STUPID idea!!!
Think well 1000 times before you do it!!!
My environment:
windows XP (x32)
ruby 1.9.3p484 (2013-11-22) [i386-mingw32]
DevKit-tdm-32-4.5.2-20111229-1559-sfx
ImageMagick-6.8.8-2-Q8-x64-static.exe
I'm using this manual: https://github.com/oneclick/rubyinstaller/wiki/Development-Kit
I did more than 3 attempts to install it!
It's easier and better to buy new laptop or install Linux on your machine!!!
After 4 hours of pain and suffering I was fortunate to run 'bundle install' successful.
Incidentally, I recommend:
install ruby to C:/ruby193 ( not into 'Program Files' !!! )
install devkit to C:/DevKit ( not into 'Program Files' !!! )
I don't understand WTF is going on with this. And now I have new error :)
This is a magic problem with ImageMagik ( I think Satan himself wrote this program! )
Now I can't install rmagick, cause of some problem of ruby,devkit, ImageMagik or rmagik.
I see this error, when run:
gem install rmagick -v '2.13.2' -- '--with-opt-dir="C:\ImageMagick"'
======================================================================
Tue 14Jan14 12:31:38
This installation of RMagick 2.13.2 is configured for
Ruby 1.9.3 (i386-mingw32) and ImageMagick 6.8.8
======================================================================
make
generating RMagick2-i386-mingw32.def
compiling rmagick.c
In file included from rmagick.c:13:0:
rmagick.h:81:2: error: #error Specified QuantumDepth is not supported.
rmagick.c: In function 'Magick_colors':
rmagick.c:42:5: warning: passing argument 2 of 'GetColorInfoList' from incompatible pointer ty
C:\ImageMagick\include/magick/color.h:75:5: note: expected 'size_t *' but argument is of type
rmagick.c: In function 'Magick_fonts':
rmagick.c:90:5: warning: passing argument 2 of 'GetTypeInfoList' from incompatible pointer typ
C:\ImageMagick\include/magick/type.h:98:5: note: expected 'size_t *' but argument is of type '
rmagick.c: In function 'Magick_init_formats':
rmagick.c:178:5: warning: passing argument 2 of 'GetMagickInfoList' from incompatible pointer
C:\ImageMagick\include/magick/magick.h:129:5: note: expected 'size_t *' but argument is of typ
make: *** [rmagick.o] Error 1
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2 for insp
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/rmagick-2.13.2/ext/RMagick/gem_make.out
After few hours I understood that, I face this problem,
cause when installing ImageMagik I forget to set one of checkboxses:
And now I see new error type in my terminal:
C:\Documents and Settings\Bogdan>gem install rmagick -v '2.13.2' -- '--with-opt-dir="C:\ImageMagick"'
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:/Ruby193/bin/ruby.exe extconf.rb --with-opt-dir="C:\ImageMagick"
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
--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
C:/Ruby193/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 C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:506:in `try_cpp'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:931:in `block in have_header'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from C:/Ruby193/lib/ruby/1.9.1/mkmf.rb:930:in `have_header'
from extconf.rb:194:in `'
What is it and how can I fix it?
Please, help me
Wow!!! This is the some kind of comedy,
but I uninstall ImageMagick-6.8.8 and install ImageMagick-6.6.7.
C:\Documents and Settings\Bogdan>gem install rmagick -v '2.13.2' -- '--with-opt-dir="C:\ImageMagick"'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed rmagick-2.13.2
1 gem installed
Installing ri documentation for rmagick-2.13.2...
Installing RDoc documentation for rmagick-2.13.2...
SUCCESSFULLY INSTALLED RMAGICK-2.13.2 !!!!!!