在Ubuntu 10.04中,我刚刚安装了rbenv。安装命令不存在。
rbenv 0.4.0-49-g8b04303
Usage: rbenv <command> [<args>]
Some useful rbenv commands are:
commands List all available rbenv commands
local Set or show the local application-specific Ruby version
global Set or show the global Ruby version
shell Set or show the shell-specific Ruby version
rehash Rehash rbenv shims (run this after installing executables)
version Show the current Ruby version and its origin
versions List all Ruby versions available to rbenv
which Display the full path to an executable
whence List all Ruby versions that contain the given executable
See `rbenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/sstephenson/rbenv#readme我遗漏了什么?
发布于 2013-07-12 23:10:59
install命令没有嵌入到rbenv中,它来自ruby-build插件。您可以使用以下命令进行安装:
git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build在Mac上,你可以通过homebrew安装它:
brew install ruby-build在Debian (版本>= 7)和Ubuntu (版本>= 12.10)上,都可以使用apt-get (或aptitude)安装rbenv和ruby-build:
sudo apt-get update
sudo apt-get install rbenv ruby-build在FreeBSD上,ruby-build在端口集合中可用,它既可以作为二进制包安装,也可以从端口构建:
# Using pkgng rbenv will be installed
pkg install ruby-build
# Building ruby-build form Ports will install rbenv only if the RBENV option is set
cd /usr/ports/devel/ruby-build
make install发布于 2014-06-17 01:31:02
我发现当从全局目录使用rbenv时,有必要导出RBENV_ROOT变量,否则它不会加载插件。
export RBENV_ROOT="/usr/local/rbenv"
if [ -d "${RBENV_ROOT}" ]; then
export PATH="${RBENV_ROOT}/bin:${PATH}"
fi发布于 2016-01-08 03:32:51
正如每个人都提到的那样,问题是缺少ruby-build。对于较旧版本的操作系统,ruby-build可能无法作为apt软件包提供。在这种情况下,使用original instructions安装,它应该在下面的代码中省略单词Optional:
git clone git@github.com:rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
# OR use http
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-buildhttps://stackoverflow.com/questions/17618113
复制相似问题