简体   繁体   中英

Failed to Build Gem Extension Error Installing rails

I'm on a fresh Ubuntu installation and using the guide to install rails found here .

When I get to the final sudo gem install rails , I get this error:

    Building native extensions.  This could take a while...
ERROR:  Error installing rails:
    ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/nio4r-1.2.1/ext/nio4r
/usr/bin/ruby2.3 -r ./siteconf20160821-19665-u7rxlt.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/nio4r-1.2.1 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nio4r-1.2.1/gem_make.out

Try this

gem update --system 2.0.3

Ref: https://stackoverflow.com/a/17657242/4132578

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