gpt4 book ai didi

ruby-on-rails - rbenv 不能在 ubuntu 上使用 rbenv 和 ruby​​-build 工作吗?

转载 作者:数据小太阳 更新时间:2023-10-29 07:52:30 25 4
gpt4 key购买 nike

我刚刚在我的 ubuntu 服务器上安装了 rbenv 和 ruby​​-build。这是 ubntu 版本:

Description:  Ubuntu 14.04.1 LTS
Release: 14.04

然后我安装了 rbenv 0.4.0

rbenv 有两个问题。首先,当我输入以下命令时,它不会显示最新版本的 ruby​​:

rbenv install -v The result would is this:

usage: rbenv install VERSION
rbenv install /path/to/definition

Available versions:
1.8.6-p383
1.8.6-p420
1.8.7-p249
1.8.7-p302
1.8.7-p334
1.8.7-p352
1.8.7-p357
1.8.7-p358
1.9.1-p378
1.9.2-p180
1.9.2-p290
1.9.2-p318
1.9.2-p320
1.9.3-dev
1.9.3-p0
1.9.3-p125
1.9.3-p194
1.9.3-preview1
1.9.3-rc1
2.0.0-dev jruby-1.6.3 jruby-1.6.4 jruby-1.6.5 jruby-1.6.5.1 jruby-1.6.6 jruby-1.6.7 jruby-1.6.7.2 jruby-1.7.0-preview1 maglev-1.0.0 rbx-1.2.4 rbx-2.0.0-dev ree-1.8.6-2009.06 ree-1.8.7-2009.09 ree-1.8.7-2009.10 ree-1.8.7-2010.01 ree-1.8.7-2010.02 ree-1.8.7-2011.03 ree-1.8.7-2011.12 ree-1.8.7-2012.01 ree-1.8.7-2012.02

如您所知,最新版本是 2.2.2!

除了每次我尝试这个:

rbenv install 2.0.0-dev

结果是这样的:

Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...

BUILD FAILED

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

Last 10 log lines:
make[2]: Entering directory `/tmp/ruby-build.20150125192327.14980/yaml-0.1.4/include'
make[2]: Nothing to be done for `install-exec-am'.
test -z "/home/amirabbas/.rbenv/versions/2.0.0-dev/include" || /bin/mkdir -p "/home/amirabbas/.rbenv/versions/2.0.0-dev/include"
/usr/bin/install -c -m 644 yaml.h '/home/amirabbas/.rbenv/versions/2.0.0-dev/include/.'
/usr/bin/install: cannot remove ‘/home/amirabbas/.rbenv/versions/2.0.0-dev/include/./yaml.h’: Permission denied
make[2]: *** [install-nobase_includeHEADERS] Error 1
make[2]: Leaving directory `/tmp/ruby-build.20150125192327.14980/yaml-0.1.4/include'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/tmp/ruby-build.20150125192327.14980/yaml-0.1.4/include'
make: *** [install-recursive] Error 1

最佳答案

关于你必须更新 ruby​​-build gem 的 Ruby 版本:

cd ~/.rbenv/plugins/ruby-build/
git pull

那么您将拥有 2.2 版本。

Ruby 有一些 native 依赖项,​​因此您必须在安装 Ruby 之前安装它们:

sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties

来源:https://gorails.com/setup/ubuntu/14.10

关于ruby-on-rails - rbenv 不能在 ubuntu 上使用 rbenv 和 ruby​​-build 工作吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28138315/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com