我rvm用来管理不同的红宝石及其宝石.我的shell是zsh,配置了基本设置的oh-my-zsh.启用oh-my-zsh插件是ruby,rails,osx和git.这是我用来安装ruby-1.8.7和rails-3.0.7的命令.
rvm install 1.8.7
rvm use 1.8.7
gem install rails -v=3.0.7
Run Code Online (Sandbox Code Playgroud)
然后我打字rails并得到:
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
Run Code Online (Sandbox Code Playgroud)
我也尝试过更彻底的安装,比如rubygems在切换到ruby-1.8.7之后重新安装,或创建一个全新的gemset,但没有运气.
这是rvm信息:
ruby-1.8.7-p352@rails:
system:
uname: "Darwin yicai.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun 7 16:32:41 PDT 2011; root:xnu-1504.15.3~1/RELEASE_X86_64 x86_64"
bash: "/bin/bash => GNU bash, version 3.2.48(1)-release (x86_64-apple-darwin10.0)"
zsh: "/bin/zsh => zsh 4.3.9 (i386-apple-darwin10.0)"
rvm: …Run Code Online (Sandbox Code Playgroud) 我正在全新安装OS X Mountain Lion.我通过以下方式安装了rails:
sudo gem install rails
Run Code Online (Sandbox Code Playgroud)
一切似乎安装正确,但当我键入rails命令(rails s,rails -v等)时,我收到此错误:
Rails is not currently installed on this system. To get the latest version, simply type:
$ sudo gem install rails
You can then rerun your "rails" command.
Run Code Online (Sandbox Code Playgroud)
' which rails' 的结果是/usr/bin/rails
我认为这是一个路径问题,也许是,但我可以看到/ usr/bin是我的PATH的一部分.
有帮助吗?谢谢!
更新:我注意到我的其他mac上的所有内容都使用相同的操作系统非常好...我只是记不清楚我是如何以这种方式工作的.如果我运行'哪个轨道',我看到它在一个完全不同的地方/Users/username/.rvm/gems/ruby-1.9.3-p194/bin/rails