RVM 要求我在 .bash_profile 中编辑 PATH - 我担心这会很乱

RVM 要求我在 .bash_profile 中编辑 PATH - 我担心这会很乱

我正在尝试使用 Acquia Desktop Dev 在本地计算机 (OSX 10.10) 上运行 Omega 子主题。尝试在子主题目录中运行独立的 ruby​​。当我使用时,rvm list我得到:

Warning! PATH is not properly set up, '/Users/khrysztov/.rvm/gems/ruby-2.1.5/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.1.5'.

rvm rubies

=* ruby-2.1.5 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

我不确定我的 .bash_profile 的状态。它看起来像这样:

PATH=“/Users/khrysztov/.rvm/gems/ruby-2.1.5/bin:/Applications/Dev\ Desktop/drush:/Applications/MAMP/Library/bin:/Applications/MAMP/bin/php5.5.18/bin:/Applications/MobileDeveloper/adt-bundle-mac-x86_64-20130729/sdk/platform-tools:/Applications/MobileDeveloper/adt-bundle-mac-x86_64-20130729/sdk/tools:/usr/local/bin:”


    export PATH
    export "DRUSH_PHP=/Applications/Dev Desktop/php5_5/bin/php"

    export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
    export CLICOLOR=1
    export LSCOLORS=ExFxBxDxCxegedabagacad
    alias ls='ls -GFh'

    source ~/.profile

    [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*

Bash 窗口启动如下:

-bash: /Users/khrysztov/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0: is a directory
khrysztov@khrysztovs-iMac:~$ /var/folders/bx/936smxc92dg_3pnf0zswj_f40000gn/T/DevDesktopConsole

当我在 Finder 中查看 /Users/khrysztov/.rvm/gems/ruby-2.1.5/bin 时,有一个别名(称为“ruby-2.1.5@global”)链接到 /Users/khrysztov/.rvm/rubies/ruby-2.1.5/lib/ruby/gems/2.1.0,其中有几个宝石。我以前确实让 RVM 工作过,但是当我设置 drush 时它停止工作了,我重新安装了,我担心我可能有冲突的文件或 PATH 条目?

答案1

如果您只是想让该特定警告消失,只需将以下行添加到您的 .bashrc 或 .bash_profile 即可。

export PATH="$PATH:$HOME/.rvm/gems/ruby-2.1.5/bin"

现在只需提供 bashrc/bash_profile,该消息就不会再次出现。

相关内容