[英]“Cannot load such file” error when deploying Rails app to Heroku
[英]“No such file or directory” error when deploying Rails app with Thin server on Heroku
嘗試使用這些說明將我的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后它會存在,我仍然會收到錯誤。
如果它有幫助, 這里是我正在努力的網站的回購 。
可能與此問題有關https://github.com/ddollar/rails_log_stdout/issues/4
嘗試刪除config/environment.rb
和config/environments/production.rb
中的config.logger = Logger.new(STDOUT)
在您的Procfile
使用web: bundle exec rails server thin -p $PORT -e $RAILS_ENV
解決方案:我刪除了proc文件(根據這個沒有必要,只是推薦用於完全控制),現在似乎工作正常。 仍然不確定問題是什么。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.