0

更新
我现在知道(从运行heroku run bash和)部署到heroku后ls -la确实缺少该目录。config但是,它存在于本地存储库中。


.gitignore

/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3

# Ignore all logfiles and tempfiles.
/log/*.log
*.log
/tmp

在我将我的应用程序推送到 heroku 之后,我得到了一个 LoadError for /app/config/environment,这在以前的版本中没有发生过。没有进行任何更改config.ru。该文件config/environment.rb存在。

我尝试了回滚,但不能,因为以前的版本有不同的附加组件。

我该如何解决这个错误?

Heroku 日志:


2012-05-09T03:59:15+00:00 heroku[slugc]: Slug compilation started
2012-05-09T04:00:36+00:00 heroku[api]: Release v48 created by xxx
2012-05-09T04:00:36+00:00 heroku[api]: Deploy ac5eee6 by xxx
2012-05-09T04:00:36+00:00 heroku[web.1]: State changed from crashed to created
2012-05-09T04:00:36+00:00 heroku[web.1]: State changed from created to starting
2012-05-09T04:00:36+00:00 heroku[slugc]: Slug compilation finished
2012-05-09T04:00:44+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -p 6745`
2012-05-09T04:00:47+00:00 app[web.1]: /app/config.ru:3:in `require': no such file to load -- /app/config/environment (LoadError)
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/config.ru:3:in `block in <main>'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/config.ru:1:in `new'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/config.ru:1:in `<main>'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/rack/adapter/loader.rb:36:in `eval'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/rack/adapter/loader.rb:36:in `load'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/rack/adapter/loader.rb:45:in `for'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/controllers/controller.rb:169:in `load_adapter'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/controllers/controller.rb:73:in `start'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/runner.rb:185:in `run_command'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/runner.rb:151:in `run!'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/bin/thin:6:in `<top (required)>'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/thin:19:in `load'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/thin:19:in `<main>'
2012-05-09T04:00:47+00:00 app[web.1]: >> Using rack adapter
2012-05-09T04:00:48+00:00 heroku[web.1]: Process exited with status 1
2012-05-09T04:00:48+00:00 heroku[web.1]: State changed from starting to crashed

配置.ru


# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment',  __FILE__)
run ItAngel::Application
4

2 回答 2

0

使用发布管理http://blog.heroku.com/archives/2010/11/17/releases/每次添加或删除配置变量时,它都应该创建一个新版本,因此您应该能够回滚到即使您有不同的附加组件集。

你的 Procfile 中有什么?尝试RACK_ENV像这样指定:

web: bundle exec thin start -p $PORT -e $RACK_ENV

当你跑步时git push heroku master,一切似乎都正常吗?

于 2012-05-09T16:53:47.093 回答
0

我已经就我的应用程序的类似问题联系了 heroku,我们发现删除文件 .gitignore 旁边的文件 .slugignore 解决了这个问题。

可能与您身边的情况相同,您可以在这里看到我的问题: 为什么不推送配置文件夹?

并查看我对我的问题的回答。

我希望这个能帮上忙

于 2012-08-03T12:42:52.187 回答