Fish shell and rvm - allowing login shell

2019-07-24 12:12发布

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.

3条回答
Luminary・发光体
2楼-- · 2019-07-24 12:52

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楼-- · 2019-07-24 12:53

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

查看更多
Luminary・发光体
4楼-- · 2019-07-24 12:56

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

查看更多
登录 后发表回答