Я установил rbenv из GitHub:

git clone git://github.com/sstephenson/rbenv.git ~/.rbenv
git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

Я пытаюсь установить Ruby 2.2.0:

sudo /home/vagrant/.rbenv/bin/rbenv install 2.2.0

Как я могу это исправить?

Вот последние строки из журнала:

installing bundle gems:       /home/vagrant/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0 (build_info, cache, doc, extensions, gems, specifications)
/tmp/ruby-build.20150209193236.15392/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- zlib (LoadError)
    from /tmp/ruby-build.20150209193236.15392/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /tmp/ruby-build.20150209193236.15392/ruby-2.2.0/lib/rubygems/package.rb:46:in `<top (required)>'
    from /tmp/ruby-build.20150209193236.15392/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /tmp/ruby-build.20150209193236.15392/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /tmp/ruby-build.20150209193236.15392/ruby-2.2.0/lib/rubygems/dependency_installer.rb:3:in `<top (required)>'
    from /tmp/ruby-build.20150209193236.15392/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /tmp/ruby-build.20150209193236.15392/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /tmp/ruby-build.20150209193236.15392/ruby-2.2.0/lib/rubygems.rb:556:in `install'
    from ./tool/rbinstall.rb:717:in `block (2 levels) in <main>'
    from ./tool/rbinstall.rb:716:in `each'
    from ./tool/rbinstall.rb:716:in `block in <main>'
    from ./tool/rbinstall.rb:749:in `call'
    from ./tool/rbinstall.rb:749:in `block in <main>'
    from ./tool/rbinstall.rb:746:in `each'
    from ./tool/rbinstall.rb:746:in `<main>'
make: *** [do-install-all] Error 1

1 ответ1

3

У вас не установлен zlib. Для правильной среды сборки выполните следующее:

Ubuntu/Debian:

apt-get install autoconf bison build-essential libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev

CentOS/Fedora:

yum install -y gcc openssl-devel libyaml-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel

Для получения дополнительной информации, прочитайте ruby-build wiki.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками .