Fish shell and rvm - allowing login shell

两盒软妹~` 提交于 2019-12-11 05:29:00

问题


When I try to use rvm in fish shell, I get this message:

ciembor@ciembor ~> rvm use 1.9.2

RVM is not a function, selecting rubies with 'rvm use ...' will not work.

You need to change your terminal emulator preferences to allow login shell. Sometimes it is required to use /bin/bash --login as the command. Please visit https://rvm.io/integration/gnome-terminal/ for a example.

I get used to use /bin/bash --login, then rvm and then starting fish from bash. But isn't there more straightforward way? I use xfce4 terminal.


回答1:


I had the same issue. Download the rvm fish function from GitHub:

curl --create-dirs -o ~/.config/fish/functions/rvm.fish https://raw.github.com/lunks/fish-nuggets/master/functions/rvm.fish

Reference: http://rvm.io/integration/fish




回答2:


Download the fish functions from GitHub.

curl -L --create-dirs -o ~/.config/fish/functions/rvm.fish https://raw.github.com/lunks/fish-nuggets/master/functions/rvm.fish

And activate the default Ruby manually in your config.fish file:

echo "rvm default" >> ~/.config/fish/config.fish

And you're done




回答3:


Try look at bash "initialization" files like ~/.bashrc ~/.bash_profile and session "initialization" files ~/.profile /etc/profile* and add rvm related code(something like

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

) to fish "initialization" file ~/.config/fish/config.fish



来源:https://stackoverflow.com/questions/18824764/fish-shell-and-rvm-allowing-login-shell

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!