另一个" PATH没有设置!"错误

时间:2018-01-11 15:50:19

标签: ruby-on-rails ruby macos terminal rubygems

所以我一直潜伏在这里寻找解决问题的方法。我正在尝试运行ruby并通过终端在我的OSX上安装gem。我正在尝试设置我的路径,但是我遇到了多个问题。当我尝试运行rvm ls时,我得到了

Warning! PATH is not properly set up, '/Users/user/.rvm/gems/ruby-2.4.0/bin' is not at first place.
         Usually this is caused by shell initialization files. Search for 'PATH=...' entries.
         You can also re-add RVM to your profile by running: 'rvm get stable --auto-dotfiles'.
         To fix it temporarily in this shell session run: 'rvm use ruby-2.4.0'.
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.

我的bashrc文件有

# Add RVM to PATH for scripting. Make sure this is the last PATH variable change.
export PATH="$PATH:$HOME/.rvm/bin"

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

和我的.bash_profile

    [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile

# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH

# Load RVM into a shell session *as a function*

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

当我尝试运行rvm get stable --auto-dotfiles时,我得到了这个:

    Adding rvm loading line to /Users/user/.profile /Users/user/.bash_profile /Users/user/.zlogin.
    Installing rvm gem in 2 gemsetsError running 'command gem install /Users/user/.rvm/gem-cache/rvm-1.11.3.9.gem --local --no-ri --no-rdoc',
please read /Users/user/.rvm/log/1515684005_ruby-2.4.0/gem.install.rvm->=1.11.3.9.log
Error running 'command gem install /Users/user/.rvm/gem-cache/rvm-1.11.3.9.gem --local --no-ri --no-rdoc',
please read /Users/user/.rvm/log/1515684005_ruby-2.4.1/gem.install.rvm->=1.11.3.9.log
.
    Installing gem-wrappers gem in 2 gemsetsError running 'command gem install /Users/user/.rvm/gem-cache/gem-wrappers-1.3.2.gem --local --no-ri --no-rdoc',
please read /Users/user/.rvm/log/1515684005_ruby-2.4.0/gem.install.gem-wrappers->=1.3.2.log
Error running 'command gem install /Users/user/.rvm/gem-cache/gem-wrappers-1.3.2.gem --local --no-ri --no-rdoc',
please read /Users/user/.rvm/log/1515684005_ruby-2.4.1/gem.install.gem-wrappers->=1.3.2.log
.

很抱歉,如果这是一个非常简单和基本的解决方案,我有一段时间没想到红宝石或终端/自制软件,所以我迷路了

1 个答案:

答案 0 :(得分:1)

从.bashrc文件中删除它:

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