【问题标题】:Ruby of Rails shell environment variables errorRuby of Rails shell 环境变量错误
【发布时间】:2015-08-16 04:38:00
【问题描述】:

当我在.bash_profile 文件中设置环境变量并重新启动shell 时,出现以下错误:

Last login: Sat Aug 15 20:16:25 on ttys000
-bash: /Users/xxxxxxxxx/.bash_profile: line 7: unexpected EOF while looking for matching `"'
-bash: /Users/xxxxxxxx/.bash_profile: line 10: syntax error: unexpected end of file

我的.bash_profile 文件如下所示:

if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load       RVM into a shell session *as a function*
export GMAIL_USERNAME=“xxxxx@gmail.com”
export GMAIL_PASSWORD=“xxxxxx”
export MAILCHIMP_API_KEY=“xxxxxxxxxxxxxxxxxxxxxx”
export MAILCHIMP_LIST_ID=“xxxxxxxxxx”
export OWNER_EMAIL=“xxxxxx@gmail.com”

【问题讨论】:

  • ricke2005,你试过我的解决方案了吗?那应该可以解决您的问题。如果没有,请告诉我!
  • KM,刚刚尝试了您的建议,......它成功了!谢谢你。我不明白这两个符号之间的区别。你能解释一下吗?

标签: ruby-on-rails shell environment-variables


【解决方案1】:

看起来您需要将 替换为",如下所示:

if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load       RVM into a shell session *as a function*
export GMAIL_USERNAME="xxxxx@gmail.com"
export GMAIL_PASSWORD=“xxxxxx”
export MAILCHIMP_API_KEY="xxxxxxxxxxxxxxxxxxxxxx"
export MAILCHIMP_LIST_ID="xxxxxxxxxx"
export OWNER_EMAIL="xxxxxx@gmail.com"

【讨论】:

    猜你喜欢
    • 2017-10-11
    • 1970-01-01
    • 2014-09-16
    • 2012-01-09
    • 2012-08-22
    • 1970-01-01
    • 2011-04-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多