启动工头时出错 (Dotenv::FormatError)
Posted
技术标签:
【中文标题】启动工头时出错 (Dotenv::FormatError)【英文标题】:Error starting foreman (Dotenv::FormatError) 【发布时间】:2013-07-09 04:40:22 【问题描述】:我正在尝试让 node.js 应用程序开始使用工头。我在项目根目录中运行forman start
命令,我不断收到以下错误:
/Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/dotenv-0.8.0/lib/dotenv/environment.rb:34:in `block in load': Line "== project-ps Config Vars" doesn't match format (Dotenv::FormatError)
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/dotenv-0.8.0/lib/dotenv/environment.rb:27:in `each'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/dotenv-0.8.0/lib/dotenv/environment.rb:27:in `load'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/dotenv-0.8.0/lib/dotenv/environment.rb:23:in `initialize'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/foreman-0.63.0/lib/foreman/engine.rb:172:in `new'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/foreman-0.63.0/lib/foreman/engine.rb:172:in `load_env'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/foreman-0.63.0/lib/foreman/cli.rb:136:in `load_environment!'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/foreman-0.63.0/lib/foreman/cli.rb:38:in `start'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/gems/foreman-0.63.0/bin/foreman:7:in `<top (required)>'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/bin/foreman:23:in `load'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/bin/foreman:23:in `<main>'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/Hebime/.rvm/gems/ruby-1.9.3-p448/bin/ruby_noexec_wrapper:14:in `<main>'
使用相同的命令,该项目在我的同事机器上运行良好。 我正在使用 OSX 10.8.4。
有什么想法吗?
谢谢!
【问题讨论】:
你能告诉我们你的 .env 文件的内容吗? (删除任何敏感信息) 【参考方案1】:我也遇到了这个错误。就我而言,我不小心在我的 .env 文件中包含了一个“激活”命令:
. venv/bin/activate
export DEBUG=True
...
当我运行 foreman 时,它解析了 .env 文件,并在第一行中偶然发现。通过注释掉该激活命令,问题就消失了。
【讨论】:
以上是关于启动工头时出错 (Dotenv::FormatError)的主要内容,如果未能解决你的问题,请参考以下文章