开发者

Rails on Linux Mint 11

I have installed ruby via rvm on Mint 11 no problem. Installed gems, ditto. Installed rails via gem install rails, and when I type rails -v it returns the correct version. Until I close that terminal and reopen a terminal. When I do that and type rails -v开发者_高级运维 I get the message

The program 'rails' is currently not installed.  You can install it by typing: sudo apt-get install rails

If I then type

rvm use 1.9.2-p180 --default

and then type rails -v I again get the correct version...until I close the terminal.

I should add that I have added a path statement to my .bashrc pointing to the 1.9.2-p180 directory in my .rvm directory.

Typing ruby -v always returns the correct version.


Create .bashrc file and add .rvm command

$ sudo touch ~/.bashrc

$ sudo gedit ~/.bashrc

(Add line to .bashrc file)

if [[ -s "$HOME/.rvm/scripts/rvm" ]]  ; then source "$HOME/.rvm/scripts/rvm" ; fi

Logout and Login OR just update user profile from .bashrc with following command

$ . ~/.bashrc


Try adding this command to your .profile and reopening your shell:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"  # This loads RVM into a shell session.


Use project rvmrc files. You can see how to set this up here http://beginrescueend.com/rvm/best-practices/

That way you keep all your gems seperate for each project and it's dead simple to set up


Try which rails. Maybe there is a link to a stub that gives you the note. If that is the case calling the full path might help, e.g. /usr/local/bin/rails

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜