1

I am installing one app and I was in this step that I should run bundle install and I get this error

enter code here➜  mavatar git:(master) ✗ bundle install 
Fetching gem metadata from http://rubygems.org/
Fetching version metadata from http://rubygems.org/
Fetching dependency metadata from http://rubygems.org/
Using rake 0.9.2
Using multi_json 1.8.2
Using bcrypt-ruby 3.0.1
Using builder 3.0.4
Using i18n 0.6.5
Using erubis 2.7.0
Using rack 1.3.6
Using hike 1.2.1
Using tilt 1.3.3
Installing nokogiri 1.5.0 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /home/farbodi/.rvm/gems/ruby-2.3.0-

dev/gems/nokogiri-1.5.0/ext/nokogiri
/home/farbodi/.rvm/rubies/ruby-2.3.0-dev/bin/ruby -r
./siteconf20160806-31805-mdcnrl.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
 necessary
 libraries and/or headers.  Check the mkmf.log file for more details. 
You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/home/farbodi/.rvm/rubies/ruby-2.3.0-dev/bin/$(RUBY_BASE_NAME)
 extconf.rb:10:in `<main>': uninitialized constant Config (NameError)
 Did you mean?  RbConfig
           CONFIG

 extconf failed, exit code 1

 Gem files will remain installed in /home/farbodi/.rvm/gems/ruby- 
 2.3.0-dev/gems/nokogiri-1.5.0 for inspection.
 Results logged to /home/farbodi/.rvm/gems/ruby-2.3.0- 
 dev/extensions/x86_64-linux/2.3.0/nokogiri-1.5.0/gem_make.out
 Your Gemfile.lock is corrupt. The following gems are missing from the    
 DEPENDENCIES section: 'archive-tar-minitar' 'hoe' 'rcov'

So I tried to run this : gem update

gem install hoe
gem install rcov
gem install archive-tar-minitar 
gem install nokogiri -v 1.5.0 which gives me ERROR: Failed to build   gem native extension. error

I also installed bundle older version, I can pass this step but I get same problem in somewhere else. I also used rvm and my ruby version is ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux] , And Bundler version 1.12.5

I am new to ruby and gem and bundle I am all confused and I don't know how to start to learn what is going on and how to solve the errors.

1 Answers1

0

You need to install some system packages.

If you are using redhat based, install libxml2 and libxslt and zlib-devel

and if you are using debian based, install zlib1g-dev and liblzma-dev packages

Ebrahim Pasbani
  • 9,168
  • 2
  • 23
  • 30
  • I forgot to mention I also installed them. – Farbod Ghiasi Aug 07 '16 at 01:03
  • @FarbodGhiasi So did you try this before : `gem install nokogiri -- --use-system-libraries` ? – Ebrahim Pasbani Aug 07 '16 at 01:03
  • yes I get this errors: ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. ERROR: cannot discover where libxml2 is located on your system. please make sure `pkg-config` is installed. *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. – Farbod Ghiasi Aug 07 '16 at 01:10
  • @FarbodGhiasi Can you please show the content of `/home/farbodi/.rvm/gems/ruby-2.3.0- dev/extensions/x86_64-linux/2.3.0/nokogiri-1.5.0/gem_make.out`? – Ebrahim Pasbani Aug 07 '16 at 01:11
  • Are you sure `libxml2` is installed? What is your OS? – Ebrahim Pasbani Aug 07 '16 at 01:12
  • current directory: /home/farbodi/.rvm/gems/ruby-2.3.0-dev/gems/nokogiri-1.5.0/ext/nokogiri /home/farbodi/.rvm/rubies/ruby-2.3.0-dev/bin/ruby -r ./siteconf20160806-32640-k0nte5.rb extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You – Farbod Ghiasi Aug 07 '16 at 01:15
  • may need configuration options. Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/farbodi/.rvm/rubies/ruby-2.3.0-dev/bin/$(RUBY_BASE_NAME) extconf.rb:10:in `
    ': uninitialized constant Config (NameError) Did you mean? RbConfig CONFIG extconf failed, exit code 1
    – Farbod Ghiasi Aug 07 '16 at 01:15
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/120336/discussion-between-farbod-ghiasi-and-ebrahim-pasbani). – Farbod Ghiasi Aug 07 '16 at 01:22