2017-10-24 8 views
2

現在、twitter、fb、instagramログインオプションを持つrailsアプリケーションをビルドしています。私は私のbash_profileのこの部分が間違っている推測しているbash_profileを入手するときに解析エラーが発生する

`(eval):1: parse error near `then' ` 

私は右トークンとすべてを入力されたが、私はソースbash_profileを行うとき、それは私に、このエラーを与えますか?

export PATH=/usr/local/bin:$PATH 
export PATH=$HOME/.rbenv/bin:$PATH 

eval "$(rbenv init -)" 

どのように修正できますか?


私がヒット、 'rbenv initを - ' 私は、Bashのために、次の

export PATH="/Users/sugawara/.rbenv/shims:${PATH}" 
export RBENV_SHELL=zsh 
source '/usr/local/Cellar/rbenv/1.1.1/libexec/../completions/rbenv.zsh' 
command rbenv rehash 2>/dev/null 
rbenv() { 
    local command 
    command="$1" 
    if [ "$#" -gt 0 ]; then 
    shift 
    fi 

case "$command" in 
    rehash|shell) 
    eval "$(rbenv "sh-$command" "[email protected]")";; 
    *) 
    command rbenv "$command" "[email protected]";; 
    esac 
} 
+0

'rbenvのinit -'の出力を示してください、結局のところ、それがエラーの原因です。 – Socowi

+0

@ソコウィ私はあなたの質問に答えを加えました!どうも! –

+1

'bash'スクリプトから' zsh'ファイルを入手しています。これはおそらくエラーの原因になります。 – chepner

答えて

1

RBenvの統合は、次のようになり得る:

export PATH="/Users/sugawara/.rbenv/shims:${PATH}" 
export RBENV_SHELL=bash 
source '/usr/local/Cellar/rbenv/1.1.1/libexec/../completions/rbenv.bash' 
command rbenv rehash 2>/dev/null 
rbenv() { 
    local command 
    command="$1" 
    if [ "$#" -gt 0 ]; then 
    shift 
    fi 

    case "$command" in 
    rehash|shell) 
    eval "$(rbenv "sh-$command" "[email protected]")";; 
    *) 
    command rbenv "$command" "[email protected]";; 
    esac 
} 

私は考えることができる唯一のexplaination rbenv init -がZSHシェルのための命令を出力するためには、あなたが実際にbashの代わりにzshを実行している可能性があります。

+0

そのため、彼は 'zsh'ファイルの' near then'に解析エラーがありますか? –

+0

これはあまり意味のない部分です@FabrizioBertoglio。 – max

0

私の意見、Maxから答えを読むことあなたがrbenvを設定するfollow the instructionsする必要があることです後、特にセットまでご~/.zshrcファイルを代わりに~.bash_profile

のあなたへ〜/ .rbenv/binを追加しますrbenvコマンドラインユーティリティにアクセスするための$ PATH。

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc 

Ubuntuのデスクトップ・ノート:変更あなたの〜/ .bashrcの代わりに〜/ .bash_profileを。
Zsh注:〜/ .bash_profileではなく〜/ .zshrcファイルを変更してください。

あなたrbenv init -出力などから、我々はそれを見ることができます:

export RBENV_SHELL=zsh 
source '/usr/local/Cellar/rbenv/1.1.1/libexec/../completions/rbenv.zsh' 

をので、おそらく、あなたの代わりにあなたの~/.zshrcファイルを設定する必要があり、あなたの~/.bash_profile

関連する問題