安装Ruby我一直on Rails的在Mac上从本网站安装Ruby教程以下未发现:RVM而on Rails的
http://ruby.railstutorial.org/
我安装RVM,它不能正常工作。本教程说输入以下命令:
~ $ [[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"
后,我这样做,它似乎,它说这已成功加载:
~ DUFF$ rvm reload
RVM reloaded!
~ DUFF$ rvm notes
Notes for Darwin (Mac OS X)
For Lion, Rubies should be built using gcc rather than llvm-gcc. Since
/usr/bin/gcc is now linked to /usr/bin/llvm-gcc-4.2, add the following to
your shell's start-up file: export CC=gcc-4.2
(The situation with LLVM and Ruby may improve. This is as of 07-23-2011.)
For Snow Leopard be sure to have Xcode Tools Version 3.2.1 (1613) or later
You should download the latest Xcode tools from developer.apple.com.
(This is since the dvd install for Snow Leopard contained bugs).
If you intend on installing MacRuby you must install LLVM first.
If you intend on installing JRuby you must install the JDK.
If you intend on installing IronRuby you must install Mono (version 2.6 or greater is recommended).
To seamlessly abandon the Apple-installed system ruby (ruby 1.8.7 patchlevel 174 for Snow Leopard):
rvm install 1.8.7 # installs patch 302: closest supported version
rvm system ; rvm gemset export system.gems ; rvm 1.8.7 ; rvm gemset import system # migrate your gems
rvm --default 1.8.7
NOTE: For all installations, as of 1.7, RVM no longer autoloads .rvmrc files. In order to return this functionality, you MUST add 'export rvm_project_rvmrc=1' to your $HOME/.rvmrc file. This causes RVM to override 'cd' which, while toggleable even < 1.7, is currently defaulted to 'off'. This knob returns the previous behaviour to active which causes per-project .rvmrc files to be loaded once again.
例如:echo '出口rvm_project_rvmrc = 1' >> $ HOME /.rvmrc & & RVM重装
所以,毕竟我进入这个遵医嘱:
type rvm | head -n1
,它说:
-bash: type: rvm: not found
这样长的介绍后,我的问题是你知道它为什么不承认RVM类型它似乎已经安装之后。我是一个完整的新手,所以请温柔。我一直在讨论很多问题,直到现在这个问题似乎都很顺利。
任何帮助,将不胜感激。谢谢。
感谢您的答复。我试过这个命令,我仍然得到相同的回应。但是,我是一个新手,我可能会错误地进行测试。要查看它是否有效,我只需键入: rvm --version 这就是我如何看到它的工作原理。我仍然收到说没有找到rvm命令的错误。我很困惑。 – Matt
首先,您应该验证您是否运行'cat〜/ .bash_profile'正确运行命令,并确保您看到[[-s“$ HOME/.rvm/scripts/rvm”]] &&。 “$ HOME/.rvm/scripts/rvm”#在输出结尾处加载RVM函数。如果你这么做,像@jonallard建议的那样,打开一个新的终端,或运行命令'source〜/ .bash_profile'来重新加载你的环境。你还应该通过列出目录“ls〜/ .rvm”来确保你拥有所有的rvm脚本。你应该看到bin,脚本,配置等等。如果一切都失败,请删除rvm目录'sudo rm -R〜/ .rvm'并从顶部开始。 –
另外,如果你重新开始,我建议从最新的git版本安装,运行'bash <<(curl -s https://rvm.beginrescueend.com/install/rvm)',注意'bash'不是一些占位符为您的shell提示符,它的命令的一部分...对不起,以解释但不知道你怎么noob ...哈哈 –