Błąd instalacji Nokogiri 1.5.0 z rails 3.1.0 i ubuntu

Oto błąd uruchamiający pakiet install vendor / gems na serwerze:

Installing nokogiri (1.5.0) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /home/dtt/.rvm/rubies/ruby-1.9.2-p290/bin/ruby extconf.rb
checking for libxml/parser.h... no
-----
libxml2 is missing.  please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** 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/dtt/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
        --with-zlib-dir
        --without-zlib-dir
        --with-zlib-include
        --without-zlib-include=${zlib-dir}/include
        --with-zlib-lib
        --without-zlib-lib=${zlib-dir}/lib
        --with-iconv-dir
        --without-iconv-dir
        --with-iconv-include
        --without-iconv-include=${iconv-dir}/include
        --with-iconv-lib
        --without-iconv-lib=${iconv-dir}/lib
        --with-xml2-dir
        --without-xml2-dir
        --with-xml2-include
        --without-xml2-include=${xml2-dir}/include
        --with-xml2-lib
        --without-xml2-lib=${xml2-dir}/lib
        --with-xslt-dir
        --without-xslt-dir
        --with-xslt-include
        --without-xslt-include=${xslt-dir}/include
        --with-xslt-lib
        --without-xslt-lib=${xslt-dir}/lib


Gem files will remain installed in /vol/www/emclab/releases/20111104001151/vendor/gems/ruby/1.9.1/gems/nokogiri-1.5.0 for inspection.
Results logged to /vol/www/emclab/releases/20111104001151/vendor/gems/ruby/1.9.1/gems/nokogiri-1.5.0/ext/nokogiri/gem_make.out
An error occured while installing nokogiri (1.5.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.0'` succeeds before bundling.
Możesz pominąć tę część. Komunikat o błędzie jest w zasadzie oczywisty, ale strona internetowa wymaga jeszcze kilku słów wyjaśniających kod. Jakieś pomysły?
Author: the Tin Man, 2011-11-04

8 answers

Musisz mieć wszystkie niezbędne biblioteki zainstalowane na twoim komputerze. Po zainstalowaniu RVM, powinien był wymienić to dla Ciebie. W bieżącej wersji rvm możesz uruchomić rvm requirements, aby zobaczyć dokładną listę. W tej chwili ta lista to:

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

 63
Author: Dylan Markow,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2011-11-04 00:25:24

Brakuje ci kilku pakietów. Spróbuj uruchomić to (tylko Linux):

$ sudo apt-get install libxslt-dev libxml2-dev
 25
Author: jimnah,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2013-04-07 00:52:20

Wygląda na błąd zależności klejnotu.

Musisz uruchomić bundle update polecenie. Rozwiąże zależności:

bundle update
 5
Author: Laxman More,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-11-19 23:34:25

Musisz zainstalować libxml2.

Na Mac OS, używając homebrew, będzie to:

brew install libxml2

Zobacz http://nokogiri.org/tutorials/installing_nokogiri.html .

 5
Author: ipd,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-11-19 23:37:20

Po prostu zrób to:

sudo apt-get install libxslt-dev libxml2-dev libxml2

Następnie wpisz to w terminalu (linux) / cmd (windows):

export NOKOGIRI_USE_SYSTEM_LIBRARIES=true
 4
Author: user3786185,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-06-28 15:30:42

Spróbuj tego, jeśli inne nie działają, to naprawdę działa na mnie. Devtools for CentOS

 0
Author: agstwn21,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2014-09-08 08:00:18

Kiedy użyłem tego kodu dostałem kolejny błąd:

ERROR:  Error installing disposable:
    invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /home/admin/.rvm/gems/ruby-2.1.3@lol/cache/nokogiri-1.6.4.1.gem

Próbowałem wielu różnych rozwiązań, ale pomogłem med:

$ rm /home/admin/.rvm/gems/ruby-2.1.3@lol/cache/nokogiri-1.6.4.1.gem
$ gem update
$ gem install nokogiri

Inne polecenia, które mogą pomóc:

sudo apt-get install synaptic
sudo apt-get update
sudo apt-get install qt4-dev-tools libqt4-dev libqt4-core libqt4-gui
sudo apt-get install build-essential
sudo apt-get install "^libxcb.*" libx11-xcb-dev libglu1-mesa-dev libxrender-dev
 0
Author: Darex1991,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2015-11-19 23:35:55

Dla Ubuntu:

sudo apt-get install libxml2 libxml2-dev libxslt-dev zlib1g-dev
sudo gem install nokogiri -v '1.8.2' -- --use-system-libraries 

Dla MacOS:

brew install libxml2
gem install nokogiri -v '1.8.2' -- --use-system-libraries \
  --with-xml2-include=$(brew --prefix libxml2)/include/libxml2
 0
Author: shilovk,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/doraprojects.net/template/agent.layouts/content.php on line 54
2020-05-05 21:29:06