在 Deepin 15.10 上使用 rbenv 安装 Ruby

Installing Ruby using rbenv on Deepin 15.10

尝试使用 rbenv(或我尝试过 RVM 和 ruby-install 的任何其他安装程序)安装 Ruby 失败并出现此错误

$ rbenv install 2.6.3

> Downloading ruby-2.6.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.bz2
Installing ruby-2.6.3...
ruby-build: use readline from homebrew

BUILD FAILED (Deepin 15.10 using ruby-build 20190423)

Inspect or clean up the working tree at /tmp/ruby-build.20190507002901.29361
Results logged to /tmp/ruby-build.20190507002901.29361.log

Last 10 log lines:
    from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/package.rb:44:in `<top (required)>'
    from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/installer.rb:11:in `<top (required)>'
    from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /tmp/ruby-build.20190507002901.29361/ruby-2.6.3/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from ./tool/rbinstall.rb:703:in `<module:RbInstall>'
    from ./tool/rbinstall.rb:639:in `<main>'
uncommon.mk:364: recipe for target 'do-install-all' failed
make: *** [do-install-all] Error 1

试试这个:

$ TMPDIR=~/tmp/ rbenv install 2.6.3

终于修好了!! 我不得不使用 brew unlink openssl 然后 sudo apt-get install -y libssl-dev zlib1g-dev 然后我尝试了 rbenv install 2.6.3 并且成功了!