Rails Foreman启动错误

时间:2014-04-14 22:58:43

标签: ruby ruby-on-rails-4 unicorn foreman heroku-toolbelt

尝试使用foreman(ruby 1.9.3 rails 4)在本地运行我的应用程序:https://devcenter.heroku.com/articles/getting-started-with-rails4

我收到以下错误,有没有人有任何建议来解决这个问题 - 先谢谢大家:

C:\Sites\joshuapp>foreman start
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/dotenv-0.10.0/lib/dotenv/en
vironment.rb:53:in `block in load': Line "\"RACK_ENV=development\" " doesn't mat
ch format (Dotenv::FormatError)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/dotenv-0.10.0/
lib/dotenv/environment.rb:33:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/dotenv-0.10.0/
lib/dotenv/environment.rb:33:in `load'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/dotenv-0.10.0/
lib/dotenv/environment.rb:29:in `initialize'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/foreman-0.63.0
/lib/foreman/engine.rb:172:in `new'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/foreman-0.63.0
/lib/foreman/engine.rb:172:in `load_env'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/foreman-0.63.0
/lib/foreman/cli.rb:136:in `load_environment!'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/foreman-0.63.0
/lib/foreman/cli.rb:38:in `start'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.18.1/li
b/thor/command.rb:27:in `run'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.18.1/li
b/thor/invocation.rb:120:in `invoke_command'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.18.1/li
b/thor.rb:363:in `dispatch'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/thor-0.18.1/li
b/thor/base.rb:439:in `start'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/foreman-0.63.0
/bin/foreman:7:in `<top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/bin/foreman:23:in `load'
        from C:/RailsInstaller/Ruby1.9.3/bin/foreman:23:in `<main>'

3 个答案:

答案 0 :(得分:0)

您似乎在RACK_ENV=development字符串

周围有不必要的引号

答案 1 :(得分:0)

你可能有错误版本的dotenv。我刚刚遇到了同样的问题。我调试了我的dotenv版本:

➜ gem list | grep dotenv

截至本文撰写时,最新版本似乎是0.11.1,因此这是自动安装的。要解决这个问题,只需在Gemfile中添加所需的dotenv版本,然后输入“bundle install”

  gem 'dotenv', '~> 0.1.0'
瞧......工头开始了。

答案 2 :(得分:0)

您需要检查.env文件的格式。它可能格式错误,请注意日志中的Dotenv::FormatError