"没有这样的文件或目录"在Heroku上使用瘦服务器部署Rails应用程序时出错

时间:2012-03-12 17:46:57

标签: ruby-on-rails heroku thin

尝试使用these instructions将我的Rails应用切换到瘦服务器后,我在heroku logs收到此错误,我的应用无法启动。

2012-03-12T17:00:46+00:00 heroku[web.1]: Starting process with command `bundle exec rails server thin -p 42557 -e production/production` 
2012-03-12T17:00:56+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2012-03-12T17:00:56+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /app/config/environment.rb:5) 
2012-03-12T17:00:56+00:00 app[web.1]: DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or

2012-03-12T17:01:00+00:00 app[web.1]: => Booting Thin 
2012-03-12T17:01:00+00:00 app[web.1]: => Rails 3.2.1 application starting in production on http://0.0.0.0:42557 
2012-03-12T17:01:00+00:00 app[web.1]: => Call with -d to detach 
2012-03-12T17:01:00+00:00 app[web.1]: => Ctrl-C to shutdown server 
2012-03-12T17:01:00+00:00 app[web.1]: Exiting 
2012-03-12T17:01:00+00:00 app[web.1]: /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/rack/log_tailer.rb:8:in `size': No such file or directory - log/production/production.log (Errno::ENOENT) 
2012-03-12T17:01:00+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/rack/log_tailer.rb:8:in `initialize' 
2012-03-12T17:01:00+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:295:in `new' 
2012-03-12T17:01:00+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:295:in `block in build_app' 
2012-03-12T17:01:00+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:291:in `reverse_each' 
2012-03-12T17:01:00+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:291:in `build_app' 
2012-03-12T17:01:00+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:301:in `wrapped_app' 
2012-03-12T17:01:00+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/server.rb:252:in `start' 
2012-03-12T17:01:00+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands/server.rb:70:in `start' 
2012-03-12T17:01:00+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:55:in `block in <top (required)>' 
2012-03-12T17:01:00+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:50:in `tap' 
2012-03-12T17:01:00+00:00 app[web.1]: from /app/vendor/bundle/ruby/1.9.1/gems/railties-3.2.1/lib/rails/commands.rb:50:in `<top (required)>' 
2012-03-12T17:01:00+00:00 app[web.1]: from script/rails:6:in `require' 
2012-03-12T17:01:00+00:00 app[web.1]: from script/rails:6:in `<main>' 
2012-03-12T17:01:01+00:00 heroku[web.1]: Process exited with status 1 
2012-03-12T17:01:01+00:00 heroku[web.1]: State changed from starting to crashed

破坏事物的实际错误似乎是:

  

没有这样的文件或目录 - log / production / production.log(Errno :: ENOENT)

我需要做些什么才能让它消失?我甚至手动在log/production/production.log中添加了一个空文件,并从.gitignore中删除了日志文件,以便在推送到Heroku后它会存在,我仍然会收到错误。

如果有帮助,here's the repo for the site I'm working on

2 个答案:

答案 0 :(得分:3)

可能与此问题有关 https://github.com/ddollar/rails_log_stdout/issues/4

  1. 尝试删除config.logger = Logger.new(STDOUT)config/environment.rb

  2. 中的config/environments/production.rb
  3. web: bundle exec rails server thin -p $PORT -e $RAILS_ENV

  4. 中使用Procfile

答案 1 :(得分:2)

解决方案:我删除了proc文件(根据this没有必要,只是推荐用于完全控制),现在似乎工作正常。仍然不确定问题是什么。