【发布时间】:2016-06-04 13:14:36
【问题描述】:
我使用的是 Ubuntu 14.04 LTS。
我安装了 rvm + ruby + rails 并重新启动了机器。
在我安装 Heroku toolbet 之前一切正常。
当我决定使用 rvm use ruby-2.2.1@new_app --ruby-version --create 创建一个新的项目特定 gemset 时,我收到了这条消息:
Warning! PATH is not properly set up, '/home/mark/.rvm/gems/ruby-2.2.1/bin' is not at first place,
usually this is caused by shell initialization files - check them for 'PATH=...' entries,
it might also help to re-add RVM to your dotfiles: 'rvm get stable --auto-dotfiles',
to fix temporarily in this shell session run: 'rvm use ruby-2.2.1'.
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 an example.
每次我使用 rvm 命令(例如 rvm list)时都会收到“警告!PATH 未正确设置”警告。
echo $PATH 的输出为:
/usr/local/heroku/bin:/home/mark/.rvm/gems/ruby-2.2.1/bin:/home/mark/.rvm/gems/ruby-2.2.1@global/bin:/home/mark/.rvm/rubies/ruby-2.2.1/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/mark/.rvm/bin:/home/mark/.rvm/bin:/home/mark/.rvm/bin:/home/mark/.rvm/bin
如您所见,/usr/local/heroku/bin 排在首位,而不是 /home/mark/.rvm/gems/ruby-2.2.1/bin,这可能是导致问题的原因。
我想如果/usr/local/heroku/bin 在所有 rvm 路径之后会更好。
我的.bash_profile 看起来不错:
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
我的.bashrc 文件的最后几行是:
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
### Added by the Heroku Toolbelt
export PATH="/usr/local/heroku/bin:$PATH"
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting
我尝试运行rvm get stable --auto-dotfiles(和rvm get head --auto-dotfiles,如Warning! PATH is not properly set up, usually this is caused by shell initialization files 中的建议)但没有结果。
如果可能并且我知道该怎么做,我会更改 $PATH 中路径的顺序并将 Heroku 移动到更方便的地方。
你有什么建议?
【问题讨论】:
标签: linux ubuntu rvm heroku-toolbelt