Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native gem installation doesn't work on Windows with >= 2.4.0 #977

Closed
blt04 opened this issue Jul 18, 2014 · 88 comments
Closed

Native gem installation doesn't work on Windows with >= 2.4.0 #977

blt04 opened this issue Jul 18, 2014 · 88 comments

Comments

@blt04
Copy link

@blt04 blt04 commented Jul 18, 2014

Trying to install a native gem on Windows doesn't work with RubyGems >= 2.4.0, Ruby 1.9.3-p547. DevKit is installed. As far as I can tell, this is related to b97ec2a

C:\ruby-1.9.3-p547\bin> gem install json
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing json:
        ERROR: Failed to build gem native extension.

    C:/ruby-1.9.3-p547/bin/ruby.exe -r ./siteconf20140718-2252-edb699.rb extconf.rb
creating Makefile

make  clean
Makefile:165: *** target pattern contains no `%'.  Stop.

make
Makefile:165: *** target pattern contains no `%'.  Stop.

make failed, exit code 2

Gem files will remain installed in C:/ruby-1.9.3-p547/lib/ruby/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to C:/ruby-1.9.3-p547/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/json-1.8.1/gem_make.out

If you look at the Makefile, you see:

DESTDIR = C:
sitelibdir = $(DESTDIR)./.gem.20140718-2252-16mglgm
sitearchdir = $(DESTDIR)./.gem.20140718-2252-16mglgm

With rubygems < 2.4, the Makefile would look like:

DESTDIR = C:
sitelibdir = $(DESTDIR)/ruby-1.9.3-p547/lib/ruby/gems/1.9.1/gems/json-1.8.1/ext/json/ext/generator/.gem.20140718-3932-p1yu3u
sitearchdir = $(DESTDIR)/ruby-1.9.3-p547/lib/ruby/gems/1.9.1/gems/json-1.8.1/ext/json/ext/generator/.gem.20140718-3932-p1yu3u
@holtrop
Copy link

@holtrop holtrop commented Jul 18, 2014

I'm seeing this as well with Rubygems 2.4.1, ruby 1.9.3p545 (2014-02-24) [i386-mingw32].

@drbrain drbrain added this to the 2.5 milestone Jul 20, 2014
@drbrain
Copy link
Member

@drbrain drbrain commented Jul 20, 2014

It looks like @b97ec2a will only work on Ruby 2.0.0 and newer so I will update it to not apply to early ruby.

@hehahovip
Copy link

@hehahovip hehahovip commented Jul 28, 2014

Got the same error, in Rubygems 2.4.1, ruby 1.9.3p545 (2014-02-24) [i386-mingw32].
C:\Ruby193>gem install json
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.

C:/Ruby193/bin/ruby.exe -r ./siteconf20140728-2956-j82opf.rb extconf.rb
creating Makefile

make clean
Makefile:165: *** target pattern contains no `%'. Stop.

make
Makefile:165: *** target pattern contains no `%'. Stop.

make failed, exit code 2

Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.
1 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/js
on-1.8.1/gem_make.out

C:\Ruby193>ruby -v
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]

C:\Ruby193>gem --version
2.4.1

@ghost
Copy link

@ghost ghost commented Aug 9, 2014

Same issue as above.

gem install json
Fetching: json-1.8.1.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing json:
        ERROR: Failed to build gem native extension.

    C:/Ruby193/bin/ruby.exe -r ./siteconf20140809-24288-wfgqsd.rb extconf.rb
creating Makefile

make  clean
Makefile:165: *** target pattern contains no `%'.  Stop.

make
Makefile:165: *** target pattern contains no `%'.  Stop.

make failed, exit code 2

Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/json-1.8.1 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/json-1.8.1/gem_make.out

C:\Users\pduncan\jekapp>ruby -v
ruby 1.9.3p545 (2014-02-24) [i386-mingw32]

C:\Users\pduncan\jekapp>gem --version
2.4.1
@luislavena
Copy link
Member

@luislavena luislavena commented Aug 9, 2014

@hehahovip @petedunc88 there is a issue with newer RubyGems and Ruby 1.9.3.

Until that is fixed, please revert to older version of RubyGems.

@ealexhaywood
Copy link

@ealexhaywood ealexhaywood commented Aug 13, 2014

I am having the same exact error, except with executing

gem install debugger

RubyGems 2.4.1 & Ruby 1.9.3-p429 w/ DevKit installed.

@ishristov
Copy link

@ishristov ishristov commented Aug 19, 2014

Is there any progress on this? I am getting the same error.

@ealexhaywood
Copy link

@ealexhaywood ealexhaywood commented Aug 19, 2014

No. I eventually switched over to Ubuntu Linux OS and my issue has been resolved

On Aug 19, 2014, at 4:54 AM, ishristov notifications@github.com wrote:

Is there any progress on this? I am getting the same error.


Reply to this email directly or view it on GitHub.

@luislavena
Copy link
Member

@luislavena luislavena commented Aug 19, 2014

@ishristov as commented before and also on RubyInstaller mailing list, if you're using Ruby 1.9.3, please downgrade to 1.8.29:

https://groups.google.com/d/topic/rubyinstaller/k19SeJijpKU/discussion

@XhmikosR
Copy link

@XhmikosR XhmikosR commented Sep 5, 2014

I guess gem update --system 2.3.0 is an acceptable workaround until this issue is sorted.

@net1957
Copy link

@net1957 net1957 commented Sep 10, 2014

I confirm that gem update --system 2.3.0 is working (windows 8.1 x64) but 2.4.0 and 2.4.1 fails
(ruby 1.9.3p545 (2014-02-24) [i386-mingw32])

@vaibhavatul47
Copy link

@vaibhavatul47 vaibhavatul47 commented Sep 30, 2014

gem update --system 2.3.0
this command removed error failed to build gem native extension. thanks.

@net1957
Copy link

@net1957 net1957 commented Oct 2, 2014

Not corrected in 2.4.2

@XhmikosR
Copy link

@XhmikosR XhmikosR commented Oct 2, 2014

Yeah. I still have to use the solution I mention a few posts above.
On Oct 2, 2014 9:27 PM, "net1957" notifications@github.com wrote:

Not corrected in 2.4.2


Reply to this email directly or view it on GitHub
#977 (comment).

@drbrain
Copy link
Member

@drbrain drbrain commented Oct 2, 2014

Nope, its still open, I haven't had time to fix it yet.

@akshathamk
Copy link

@akshathamk akshathamk commented Oct 10, 2014

gem update --system 2.3.0 worked for me too. Had to downgrade it from 2.4.1.

@acharyaankush
Copy link

@acharyaankush acharyaankush commented Oct 14, 2014

Downgrading to gem 2.3.0 worked. Thanks a lot!

@vishalm
Copy link

@vishalm vishalm commented Oct 20, 2014

I was working on APPIUM and thanks Downgrading to gem 2.3.0 worked. Thanks a lot!

@markdav
Copy link

@markdav markdav commented Nov 22, 2014

Thanks folks, downgrading worked for me too.

@psudarshan
Copy link

@psudarshan psudarshan commented Dec 16, 2014

Thanks a lot!! I have been searching for this solution for long time, was not able to use debugger with rubymine. Downgrading to gem 2.3.0 worked.

@egad1868
Copy link

@egad1868 egad1868 commented Dec 28, 2014

Worked for me! Thanks! Spent the last 2 days trying to get this to work !@#!

@sahilsk
Copy link

@sahilsk sahilsk commented Jan 3, 2015

thanks. It helped in installing mongoid for me.
(bson gem was stopping me from moving forward)

@mrthan
Copy link

@mrthan mrthan commented Jan 8, 2015

I'm still getting this issue in 2.4.5 - reverting to 2.3.0 fixed it thankfully. Almost lost it..

also, I did get this https issue which lead me to running gem --update-system

@indirect
Copy link
Member

@indirect indirect commented Jan 14, 2016

@duckinator awesome, thanks for figuring this out!

It seems like applying your suggested change would result in 1.9.3 acting the same way as it did before commit b97ec2a, and 2.0.0 acting the same way as it does after b97ec2a. I'm satisfied with that solution, since nothing is worse than it was before. Let's make that change and release a new 2.5.x version with the fix. That way everyone can simply run gem update --system to get the fix.

Everyone who has participated in this ticket, please consider upgrading to a newer version of Ruby. Ruby 1.9 no longer gets patches of any kind, even security updates, and Ruby 2.0 will only get security fixes until Feb. 24, 2016, when Ruby 2.1 will be moved to security-only fixes. If you want (or need) actual bugfixes in Ruby, please upgrade to Ruby 2.2 or 2.3.

@duckinator
Copy link
Member

@duckinator duckinator commented Jan 14, 2016

Pull request #1453 should resolve this, with the caveat that if you are using Ruby 1.9 on Windows and mktmpdir returns a path with a space, it will fail.

@indirect indirect closed this in 5ddb916 Jan 15, 2016
copiousfreetime added a commit to copiousfreetime/rubygems that referenced this issue Jan 31, 2016
copiousfreetime added a commit to copiousfreetime/rubygems that referenced this issue Feb 5, 2016
@venus342
Copy link

@venus342 venus342 commented May 20, 2016

Same issue. Switched to Kali Linux and it fixed my problem

@Skarlso
Copy link

@Skarlso Skarlso commented Jul 21, 2016

@duckinator OSX also suffers from this... :/

@duckinator
Copy link
Member

@duckinator duckinator commented Jul 21, 2016

What does gem --version say? If it reports a version before 2.5.2, please try updating to the latest version of RubyGems (by running gem update --system) and let me know if that fixes it.

@Skarlso
Copy link

@Skarlso Skarlso commented Jul 22, 2016

@duckinator I was using the latest. 2.6.x. I also tried to revert to using gem update --system 2.3.0 but with the same result. :/ it's not a big deal actually, because the project I'm working on just declared 1.9.x EOL. :) Which, I think is a very good move.

@pritamdstan
Copy link

@pritamdstan pritamdstan commented Sep 3, 2016

C:\beef>bundle install
Fetching gem metadata from http://rubygems.org/
Fetching version metadata from http://rubygems.org/
Fetching dependency metadata from http://rubygems.org/
Resolving dependencies...
Installing addressable 2.3.6
Installing ansi 1.4.3
Installing chunky_png 1.3.7
Installing daemons 1.1.9
Installing fastercsv 1.5.5
Installing json 1.8.1 with native extensions

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

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator

C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160904-628-402uyr.rb extconf.rb
creating Makefile

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
generating generator-x64-mingw32.def
compiling generator.c
In file included from generator.c:1:0:
../fbuffer/fbuffer.h: In function 'fbuffer_to_s':
../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given
../fbuffer/fbuffer.h:175:20: warning: initialization makes integer from pointer without a cast [enabled by default]
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/json-1.8.1/gem_make.out
Installing json_pure 1.8.3
Installing multi_json 1.9.3
Installing eventmachine 1.0.7 with native extensions
Installing erubis 2.7.0
Installing execjs 2.0.2
Installing geoip 1.4.0
Installing librex 0.0.68
Installing libv8 3.11.8.17 with native extensions

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

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8

C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160904-628-1cgf9nq.rb extconf.rb
creating Makefile
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8/builder.rb:49:in setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently not available (RuntimeError) from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8/builder.rb:35:inblock in build_libv8!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8/builder.rb:34:in chdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8/builder.rb:34:inbuild_libv8!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:24:in install!' from extconf.rb:7:in

'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/libv8-3.11.8.17/gem_make.out
Installing mime-types-data 3.2016.0521
Installing mojo_magick 0.5.6
Installing msgpack 0.5.8 with native extensions
Installing parseconfig 1.0.4
Installing rack 1.5.2
Installing rainbow 2.0.0
Installing ref 1.0.5
Installing rubyzip 1.1.3
Installing tilt 1.4.1
Installing term-ansicolor 1.1.5
Installing win32console 1.3.2 with native extensions
Using bundler 1.12.5
Installing data_objects 0.10.14
Installing dm-core 1.2.1
Installing rqrcode 0.10.1
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that gem install json -v '1.8.1' succeeds before bundling.

C:\beef>gem install debugger
Fetching: debugger-linecache-1.2.0.gem (100%)
Successfully installed debugger-linecache-1.2.0
Fetching: debugger-ruby_core_source-1.3.8.gem (100%)
Successfully installed debugger-ruby_core_source-1.3.8
Fetching: columnize-0.9.0.gem (100%)
Successfully installed columnize-0.9.0
Fetching: debugger-1.6.8.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing debugger:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/debugger-1.6.8/ext/ruby_debug

C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160904-6676-yyodsw.rb extconf.rb
*** 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:/Ruby23-x64/bin/$(RUBY_BASE_NAME)
C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:1392:in initialize': No such file or directory @ rb_sysopen - ./231/ruby_debug.h (Errno::ENOENT) from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:1392:inopen'
from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:1392:in copy_file' from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:486:incopy_file'
from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:403:in block in cp' from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:1571:inblock in fu_each_src_dest'
from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:1585:in fu_each_src_dest0' from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:1569:infu_each_src_dest'
from C:/Ruby23-x64/lib/ruby/2.3.0/fileutils.rb:402:in cp' from extconf.rb:83:inblock in

'
from extconf.rb:82:in each' from extconf.rb:82:in'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/debugger-1.6.8 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/debugger-1.6.8/gem_make.out

C:\beef>gem install bundler
Successfully installed bundler-1.12.5
Parsing documentation for bundler-1.12.5
Done installing documentation for bundler after 7 seconds
1 gem installed

C:\beef>bundle install
Fetching gem metadata from http://rubygems.org/
Fetching version metadata from http://rubygems.org/
Fetching dependency metadata from http://rubygems.org/
Resolving dependencies....
Using addressable 2.3.6
Using ansi 1.4.3
Using chunky_png 1.3.7
Using daemons 1.1.9
Using fastercsv 1.5.5
Installing json 1.8.1 with native extensions

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

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator

C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160904-1872-1a67012.rb extconf.rb
creating Makefile

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
generating generator-x64-mingw32.def
compiling generator.c
In file included from generator.c:1:0:
../fbuffer/fbuffer.h: In function 'fbuffer_to_s':
../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given
../fbuffer/fbuffer.h:175:20: warning: initialization makes integer from pointer without a cast [enabled by default]
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/json-1.8.1/gem_make.out
Using json_pure 1.8.3
Using multi_json 1.9.3
Using eventmachine 1.0.7
Using erubis 2.7.0
Using execjs 2.0.2
Using geoip 1.4.0
Using librex 0.0.68
Installing libv8 3.11.8.17 with native extensions

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

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8

C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160904-1872-1kytt9l.rb extconf.rb
creating Makefile
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8/builder.rb:49:in setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently not available (RuntimeError) from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8/builder.rb:35:inblock in build_libv8!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8/builder.rb:34:in chdir' from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8/builder.rb:34:inbuild_libv8!'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:24:in install!' from extconf.rb:7:in

'

extconf failed, exit code 1

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/libv8-3.11.8.17 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/libv8-3.11.8.17/gem_make.out
Using mime-types-data 3.2016.0521
Using mojo_magick 0.5.6
Using msgpack 0.5.8
Using parseconfig 1.0.4
Using rack 1.5.2
Using rainbow 2.0.0
Using ref 1.0.5
Using rubyzip 1.1.3
Using tilt 1.4.1
Using term-ansicolor 1.1.5
Using win32console 1.3.2
Using bundler 1.12.5
Using data_objects 0.10.14
Using dm-core 1.2.1
Using rqrcode 0.10.1
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that gem install json -v '1.8.1' succeeds before bundling.

C:\beef>gem install json -v '1.8.1'
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator

C:/Ruby23-x64/bin/ruby.exe -r ./siteconf20160904-7736-jewby.rb extconf.rb
creating Makefile

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR=" clean

current directory: C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1/ext/json/ext/generator
make "DESTDIR="
generating generator-x64-mingw32.def
compiling generator.c
In file included from generator.c:1:0:
../fbuffer/fbuffer.h: In function 'fbuffer_to_s':
../fbuffer/fbuffer.h:175:47: error: macro "rb_str_new" requires 2 arguments, but only 1 given
../fbuffer/fbuffer.h:175:20: warning: initialization makes integer from pointer without a cast [enabled by default]
make: *** [generator.o] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/json-1.8.1 for inspection.
Results logged to C:/Ruby23-x64/lib/ruby/gems/2.3.0/extensions/x64-mingw32/2.3.0/json-1.8.1/gem_make.out

C:\beef>apt-get install libgmp3-dev
'apt-get' is not recognized as an internal or external command,
operable program or batch file.

C:\beef>gem install libgmp3-dev
ERROR: Could not find a valid gem 'libgmp3-dev' (>= 0) in any repository
ERROR: Possible alternatives: libevdev, librmpd

C:\beef>install libgmp-dev
'install' is not recognized as an internal or external command,
operable program or batch file.

C:\beef>gem install libgmp-dev
ERROR: Could not find a valid gem 'libgmp-dev' (>= 0) in any repository
ERROR: Possible alternatives: libevdev, librmpd

C:\beef>gem sources -r https://rubygems.org -a http://rubygems.org
https://rubygems.org is recommended for security over http://rubygems.org

Do you want to add this insecure source? [yn] y
http://rubygems.org added to sources
source https://rubygems.org not present in cache

C:\beef>gem install libgmp3-dev
ERROR: Could not find a valid gem 'libgmp3-dev' (>= 0) in any repository
ERROR: Possible alternatives: libevdev, librmpd

C:\beef>gem install libgmp-dev
ERROR: Could not find a valid gem 'libgmp-dev' (>= 0) in any repository
ERROR: Possible alternatives: libevdev, librmpd

please help..i cannot complete the installation for beef.

@Ingosmar89219
Copy link

@Ingosmar89219 Ingosmar89219 commented Jan 9, 2017

C:\Windows\system32>gem update --system 2.3.0
ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
no such name (https://rubygems.org/specs.4.8.gz)

please help me im using windows 8.1

milendd added a commit to milendd/ruby-retrospective-2016 that referenced this issue Jan 12, 2017
Could not install rainbow 2.2.1 on Windows 7.
Tried to fix it using DevKit.

https://github.com/oneclick/rubyinstaller/wiki/Development-Kit#building-the-devkit
After following the instructions, still not worked.
Native gem installation doesn't work on Windows issue.
rubygems/rubygems#977
And finally make it work.
@aaroncalderon
Copy link

@aaroncalderon aaroncalderon commented Aug 18, 2018

Hi,

I am still experiencing this same issue on an fresh install of ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32] Windows 10. trying to install gem install jekyll

Any suggestions?

@MSP-Greg
Copy link
Contributor

@MSP-Greg MSP-Greg commented Aug 18, 2018

@aaroncalderon

This issue started with Ruby 1.9.3. Please post more info. I am familiar with newer Ruby versions on Windows...

@aaroncalderon
Copy link

@aaroncalderon aaroncalderon commented Aug 18, 2018

@MSP-Greg I am trying to install Jekyll. I already installed bundler. But, when I try to install Jekyll, I get errors.

I have tryed to downgrade to gem update --system 2.3.0 but when I do, I get other errors. I think, that is because I have the DevKit for ruby 2.5 installed.

Ruby Info

ruby --version
ruby 2.5.1p57 (2018-03-29 revision 63029) [x64-mingw32]

Installing Jekyll

I run:

gem install jekyll

I get:

Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing jekyll:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
C:/Ruby25-x64/bin/ruby.exe -r ./siteconf20180818-15452-acpiuw.rb extconf.rb
creating Makefile

current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR=" clean
'make' is not recognized as an internal or external command,
operable program or batch file.

current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR="
'make' is not recognized as an internal or external command,
operable program or batch file.

make failed, exit code 1

Gem files will remain installed in C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/http_parser.rb-0.6.0 for inspection.
Results logged to C:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/http_parser.rb-0.6.0/gem_make.out
@MSP-Greg
Copy link
Contributor

@MSP-Greg MSP-Greg commented Aug 18, 2018

@aaroncalderon

The issue is building the gem http_parser.rb. What's the output from ridk version?

@aaroncalderon
Copy link

@aaroncalderon aaroncalderon commented Aug 18, 2018

@MSP-Greg

 ridk version
---
ruby:
  path: C:/Ruby25-x64
  version: 2.5.1
  platform: x64-mingw32
ruby_installer:
  package_version: 2.5.1-2
  git_commit: 1dfa3f5
msys2:
  path: C:\dev\prd\msys64
  title: MSYS2 64bit
  version: '20180531'
sh: GNU bash, version 4.4.19(3)-release (x86_64-pc-msys)
os: Microsoft Windows [Version 10.0.16299.611]
@MSP-Greg
Copy link
Contributor

@MSP-Greg MSP-Greg commented Aug 18, 2018

@aaroncalderon

I haven't looked at the ridk code for a while, but same install on my system reports:

PS C:\Greg\GitHub> ridk version
---
ruby:
  path: C:/Greg/Ruby25-x64
  version: 2.5.1
  platform: x64-mingw32
ruby_installer:
  package_version: 2.5.1-1
  git_commit: 71c9f4e
msys2:
  path: C:\Greg\msys64
  title: MSYS2 64bit
  version: '20180531'
cc: x86_64-w64-mingw32-gcc (Rev1, Built by MSYS2 project) 8.2.0
sh: GNU bash, version 4.4.19(3)-release (x86_64-pc-msys)
os: Microsoft Windows [Version 10.0.17134.228]

It looks like your MSYS2/MinGW install is incomplete. Maybe something like:

ridk exec pacman -Sy --needed base-devel mingw-w64-x86_64-toolchain
@aaroncalderon
Copy link

@aaroncalderon aaroncalderon commented Aug 18, 2018

@MSP-Greg

You are right. I will have to configure pacman to trust a custom certificate to allow it to connect and download the packages.

I get the following message when I run the command that you suggested.

SSL certificate problem: self signed certificate in certificate chain

Will you have an idea of how to do that?

I had to do the same for npm, Vagrant, Ruby, git, wget...

Each software has it's own peculiar way to get them configured,

e.g. wget: https://stackoverflow.com/questions/22282013/how-to-use-wget-with-ssl-certificate/50494174#50494174

@MSP-Greg
Copy link
Contributor

@MSP-Greg MSP-Greg commented Aug 18, 2018

I work quite a bit with OpenSSL (I'm trying to build Ruby trunk with openssl/openssl master right now, works locally but not on Appveyor...)

I've never had an issue with Ruby or pacman. Any idea where the 'self signed cert' is?

What does ENV['SSL_CERT_FILE'] or echo %SSL_CERT_FILE% or echo $env:SSL_CERT_FILE show? I can't recall the name of it, but have you got that Windows OpenSSL package (Shining Light?) installed? If so, and if it's in your path, try removing it.

Otherwise, I'm not sure, but this isn't a RubyGems issue...

@aaroncalderon
Copy link

@aaroncalderon aaroncalderon commented Aug 19, 2018

@MSP-Greg

The self signed certificate recides at the corporate's proxy server 🙄.

On windows the environment variable SSL_CERT_FILE is not defined.

I will try to look into. So, I think you are right. It is not a ruby issue at this point.

Thanks so much.

I did had to configure ruby to use the self signed certificate.

I got the public certificate, I put it on the folder C:\Ruby25-x64\ssl\certs\ , then I executed the provided script c_rehash.rb and I was in business.

Now I have to iron out the pacman issue.

@tromlet
Copy link

@tromlet tromlet commented May 29, 2019

I appear to get the same issue on Windows:

C:\Users\User>gem install av_capture
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions. This could take a while...
ERROR:  Error installing av_capture:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/av_capture-1.0.2/ext/av_capture
C:/Ruby25-x64/bin/ruby.exe -r ./siteconf20190529-1428-gzweze.rb extconf.rb
creating Makefile

current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/av_capture-1.0.2/ext/av_capture
make "DESTDIR=" clean

current directory: C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/av_capture-1.0.2/ext/av_capture
make "DESTDIR="
generating av_capture-x64-mingw32.def
compiling connection.m
x86_64-w64-mingw32-gcc.exe: error: CreateProcess: No such file or directory
make: *** [Makefile:250: connection.o] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/av_capture-1.0.2 for inspection.
Results logged to C:/Ruby25-x64/lib/ruby/gems/2.5.0/extensions/x64-mingw32/2.5.0/av_capture-1.0.2/gem_make.out
@MSP-Greg
Copy link
Contributor

@MSP-Greg MSP-Greg commented May 29, 2019

@tromlet

See https://github.com/tenderlove/av_capture

That gem is MacOS/OSX specific.

@tromlet
Copy link

@tromlet tromlet commented May 30, 2019

Wow!

I... feel ridiculous. :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet