我刚刚在我的Ubuntu Server 10.04上安装了Rails Ready script from GitHub。 安装还可以:
Using aptitude for package installation
=> Updating system (this may take awhile)...
==> done...
=> Installing build tools...
==> done..
=> Installing libs needed for sqlite and mysql...
==> done...
=> Installing imagemagick (this may take awhile)...
==> done...
=> Installing git...
==> done...
==> done running ubuntu specific commands...
=> Installing RVM the Ruby enVironment Manager http://rvm.beginrescueend.com/rvm/install/
=> Setting up RVM to load with new shells...
==> done...
=> Loading RVM...
==> done...
=> Installing Ruby 1.9.2p136 (this will take awhile)...
=> More information about installing rubies can be found at http://rvm.beginrescueend.com/rubies/installing/
==> done...
=> Using 1.9.2 and setting it as default for new shells...
=> More information about Rubies can be found at http://rvm.beginrescueend.com/rubies/default/
==> done...
=> Reloading shell so ruby and rubygems are available...
==> done...
=> Installing Bundler, Passenger and Rails..
==> done...
#################################
### Installation is complete! ###
#################################
!!! logout and back in to access Ruby or run source ~/.bashrc !!!
Thanks!
-Josh
安装完成后,我退出并返回shell。
然后,怎么样,我不能执行任何与Rails相关的命令:
user@9001-3:~$ ruby
-bash: ruby: command not found
user@9001-3:~$ rails
-bash: rails: command not found
user@9001-3:~$ rvm
-bash: rvm: command not found
user@9001-3:~$ passenger-install-apache-module
-bash: passenger-install-apache-module: command not found
〜/ .bashrc也行不通!
user@9001-3:~$ sudo bash ~/.bashrc
/home/user/.bashrc: line 6: return: can only `return' from a function or sourced script
$rvm_path (/usr/local/rvm) does not exist.
$rvm_path (/usr/local/rvm) does not exist.user@9001-3:~$
可以在此处阅读bashrc:http://pastebin.com/6K541E2V
拜托,你能帮助我吗?
答案 0 :(得分:2)
这是因为.bashrc无法完全加载。
复制最后一行:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
到你的第一行.bashrc。在我认为它有用之后。
重新安装rvm:
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
答案 1 :(得分:1)
你说得对:你应该包含Ruby到PATH环境变量的路径。为什么〜/ .bashrc不能工作(用解决方案),例如,这里:http://forums.fedoraforum.org/showthread.php?t=215490
答案 2 :(得分:0)
我所要做的就是输入
source ~/.bashrc