从源代码编译后,为什么Ruby不可用?

时间:2013-09-29 22:33:58

标签: ruby compilation

我正在尝试将Ruby 2.0从源代码编译到Debian stable。我正在关注the steps in the chruby wiki,因为我想使用chruby来管理我的ruby版本(在此之前安装它)。所以,我在主目录的子目录中运行了这些命令:

wget http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p247.tar.gz
tar -xzvf ruby-2.0.0-p247.tar.gz
cd ruby-2.0.0-p247
./configure --prefix=/opt/rubies/ruby-2.0.0-p247
make
sudo make install

然后,我运行ruby -v以查看是否一切正常,并从shell获取消息:bash: ruby: command not found。然后我在ruby目录中运行了make check并收到了这个输出:

ruby -v: ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
check succeeded

这里出了什么问题?

1 个答案:

答案 0 :(得分:3)

/opt/rubies/ruby-2.0.0-p247/bin中有$PATH吗?使用--prefix之类的make install$prefix/bin将基本上将所有二进制文件放入$ ls /opt/rubies/ruby-2.0.0-p247

如果你这样做

{{1}}

你会看到你的所有二进制文件