简体   繁体   中英

ERROR: Failed to build gem native extension when installing rails

I'm on windows and trying to install rails. but I get the following error message:

Z:\AlexL\My Documents\rails>gem install rails
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
        ERROR: Failed to build gem native extension.

    C:/Ruby193/bin/ruby.exe -r ./siteconf20150211-3312-5ie7vd.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.
2 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/extensions/x86-mingw32/1.9.1/js
on-1.8.2/gem_make.out

Ruby version is: ruby 1.9.3p484

I've got this devkit installed DevKit-tdm-32-4.5.2-20111229-1559-sfx in this folder:

C:\\Ruby193\\DevKit\\

Not sure what else is wrong?

Looks the same as the issue being discussed here .

Apparently, there is a problem with Ruby 1.9.3 and newer RubyGems versions on Windows machines. Their quick-fix solution was to downgrade to an earlier version of RubyGems.

gem update --system 1.8.29

Once you have done that, confirm that gems -v returns 1.8.29 and try your command again.

Otherwise, you can upgrade to Ruby 2.X, which should also resolve this problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM