I am trying to install an instagram-crawler by using the gem command:

gem install instagram-crawler

But I am receiving the following error:

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

current directory: /var/lib/gems/2.5.0/gems/nokogiri-1.10.1/ext/nokogiri /usr/bin/ruby2.5

-r ./siteconf20190205-5483-1zru4h.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.5.0/gems/nokogiri-1.10.1 for inspection. Results logged to /var/lib/gems/2.5.0/extensions/x86_64-linux/2.5.0/nokogiri-1.10.1/gem_make.out


I found a similar thread somewhere. A certain package was missing. By executing the following command everything is fixed:

sudo apt-get install ruby-dev

| improve this answer | |

I did

sudo apt-get install rubygems ruby-dev

and afterwards I was able to install my gem. I believe it will do the work for yours too.

I found the answer here: StackOverflow: Gem Command not found

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.