0
votes

Screenschot of the error in my terminal

I am trying to install the gem however it wont let me due to some error , tried reading the gem documentation but couldn't figure it out myself.Thats when I needed the help of the seasoned ones.

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

current directory: /var/lib/gems/2.3.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser

/usr/bin/ruby2.3 -r ./siteconf20161223-26375-4etqmc.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/http_parser.rb-0.6.0 for inspection. Results logged to /var/lib/gems/2.3.0/extensions/x86_64-linux/2.3.0/http_parser.rb-0.6.0/gem_make.out

1
I would very much recommend installing Ruby with rvm: rvm.io rather than using system ruby and installing gems with sudo. It's recipe for disaster.Esse
...or rbenv, a bit easier I findEyeslandic
I am using rvm I forgot if ive used rvm to install rubyaspiring
pretty sure I installed ruby using rvm not the ubuntu package manager which is 'apt-get' . I just couldnt remember it and dont really know yet how to use rvm in different/switchin to different versions is ther a usefull link I could read about it?aspiring

1 Answers

1
votes

This gem is trying to compile an extension that use native C code. To do that, it looks for the C header file ruby.h which is not included in the regular Ruby runtime packages found in Ubuntu.

You probably installed Ruby using your distributions package manager. In that case you also need to install the corresponding -dev package.

In case you're using Ubuntu, it should probably be:

sudo apt-get install ruby2.3-dev

But, as already commented by @Esse, using RVM or rbenv is usually the better way to go. Also, the screenshot you provided shows that you used sudo to install the gem. This should also not be necessary and is indeed bad practice. Using RVM/rbenv will also get around this.