0

Here is the code I put in and then the error followed: I am currently figuring out rails headers and see what could be happening. I follwed this article https://gorails.com/setup/ubuntu/16.04

and this article: http://ryanbigg.com/2014/10/ubuntu-ruby-ruby-install-chruby-and-you

and nothing.

gem install rails 
ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /var/lib/gems/2.3.0 directory.
rickus@rickus:~$ sudo gem install rails
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/nokogiri-1.8.1/ext/nokogiri
/usr/bin/ruby2.3 -r ./siteconf20170928-18941-1fdewid.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/nokogiri-1.8.1 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/nokogiri-1.8.1/gem_make.out
  • 1
    try this https://stackoverflow.com/questions/20559255/error-while-installing-json-gem-mkmf-rb-cant-find-header-files-for-ruby – Aniket Tiwari Sep 29 '17 at 05:58

1 Answers1

0

Im also come up with this issue where I installed ruby environment manager rvm/ rbenv using sudo command.you can reinstall your ruby environment manager and avoid using sudo command or else all your gem installations would need sudo commands which you should avoid to prevent conflicts in the future.

Exwire
  • 81
  • 4