【问题标题】:Rails Foreman Start ErrorRails Foreman 启动错误
【发布时间】:2014-05-29 02:33:37
【问题描述】:

尝试使用 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>'

【问题讨论】:

  • 你能显示你的 .env 文件吗?

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


【解决方案1】:

似乎您在 RACK_ENV=development 字符串周围有不必要的引号

【讨论】:

  • 这些引号是由命令创建的: $ echo "RACK_ENV=development" >> .env $ echo "PORT=3000" >> .env - 他们需要被删除吗?
【解决方案2】:

您可能使用了错误版本的 dotenv。我刚刚遇到了同样的问题。我像这样调试了我的 dotenv 版本:

➜ gem list | grep dotenv

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

  gem 'dotenv', '~> 0.1.0'

瞧……工头开始了。

【讨论】:

    【解决方案3】:

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-10-02
      • 1970-01-01
      • 2019-02-26
      • 1970-01-01
      • 2015-01-16
      • 2016-09-13
      • 1970-01-01
      相关资源
      最近更新 更多