首页 > 解决方案 > 安装 Rspec 时遇到问题

问题描述

所以这是我第一次在这里提问,所以请多多包涵。在过去的几天里,我一直在尝试将 rspec 安装到我的系统上。在几个月前的一个介绍性项目之后,我熟悉了我的 Mac 安装了 ruby​​ 的事实,它不会让我真正安装任何 gem,因为它会回复权限被拒绝通知。所以我从自制软件安装了 ruby​​ 并开始了我的编码。现在我想按照我正在处理的演练安装 rspec,但系统不允许我这样做。我在网上查看过,我认为这是我的 PATH,甚至尝试多次更改它,但它不起作用。bash_profile在某一时刻,即使我source不止一次地读取文件,我的终端也不会读取我的全部内容。我已经更新到zsh它'

export PATH="/usr/local/opt:${PATH}"
export PATH="/usr/bin:/bin:/sbin:/sbin"

PATH="/usr/local/Cellar/ruby/2.7.2/bin:${PATH}" export PATH

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

# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/name/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
    \eval "$__conda_setup"
else
    if [ -f "/Users/name/opt/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/Users/name/opt/anaconda3/etc/profile.d/conda.sh"  # commented out by conda initialize
        CONDA_CHANGEPS1=false conda activate base
    else
        \export PATH="/Users/name/opt/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda init <<<

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/name/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
    eval "$__conda_setup"
else
    if [ -f "/Users/name/opt/anaconda3/etc/profile.d/conda.sh" ]; then
        . "/Users/name/opt/anaconda3/etc/profile.d/conda.sh"
    else
        export PATH="/Users/name/opt/anaconda3/bin:$PATH"
    fi
fi
unset __conda_setup
# <<< conda initialize <<<

echo "Hello World"

export PATH="/usr/local/opt/ruby/bin:$PATH"
export PATH="/usr/local/bin:$PATH"

标签: rubyrspec

解决方案


推荐阅读