本文介绍了Rails 4,资产编译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可能已经浪费了4个小时,试图让这个问题消失,不知道是什么问题。



本地我一直在创建我的Rails应用程序,资产载入正确,可以在这里看到:

 < link data-turbolinks-track =truehref =/ assets /application.css?body=1media =allrel =stylesheet/> 

所以,它可以在开发模式下工作......但是当我推送时它不起作用to heroku!

 < title> BuyABrick< / title> 
< link data-turbolinks-track =truehref =/ assets / grid-fc208f1a1279c5b79eec166dc18c02f6.cssmedia =all =stylesheet/>
< meta content =authenticity_tokenname =csrf-param/>
< meta content =aCmkfVxhDEO4PtC3AdHhLZ9smJ + 9shdchBT0mkYqQvM =name =csrf-token/>

当我点击

 < link data-turbolinks-track =truehref =/ assets / application-5c6e8eba841451fd8e44660093bd224e.cssmedia =all =stylesheet/> 

服务器向我返回内部服务器错误(编辑)意识到HTML会把这里的一切都搞砸了)





因此,我通过研究互联网为人类所知的一切尝试了所有的灵魂。这里是我拥有的文件...



config / environment / production.rb

  BuyABrick :: Application.configure do 
#此处指定的设置优先于config / application.rb中的设置。

#代码不会在请求之间重新加载。
config.cache_classes = true

#启动时加载代码。这种渴望将Rails和
#的大部分应用程序加载到内存中,从而允许线程web服务器
#以及那些依赖写入时复制的程序更好地执行。
#Rake任务会自动忽略此选项的性能。
config.eager_load = true

#完全错误报告被禁用,缓存打开。
config.consider_all_requests_local = false
config.action_controller.perform_caching = true

#启用Rack :: Cache在应用程序前放置一个简单的HTTP缓存
#在启用此功能之前将`rack-cache`添加到您的Gemfile中。
#对于大规模生产使用,请考虑使用缓存逆向代理,如nginx,varnish或squid。
#config.action_dispatch.rack_cache = true

#禁用Rails的静态资产服务器(Apache或nginx已经这样做)。
config.serve_static_assets = true

#压缩JavaScript和CSS。
config.assets.js_compressor =:uglifier
#config.assets.css_compressor =:sass

#如果预编译的资源被遗漏,不要回退到资产管道。
config.assets.compile = true

#为资产URL生成摘要。
config.assets.digest = true

#如果您希望过期所有资产,请更改此资产的版本。
config.assets.version ='1.0'

#指定服务器用于发送文件的标头。
config.action_dispatch.x_sendfile_header =nill#为apache
#config.action_dispatch.x_sendfile_header ='X-Accel-Redirect'#为nginx

#强制所有访问通过SSL的应用程序,使用Strict-Transport-Security,并使用安全cookie。
config.force_ssl = true

#设置为:debug以查看日志中的所有内容。
config.log_level =:info

#在所有日志行上加上以下标签。
#config.log_tags = [:subdomain,:uuid]

#为分布式设置使用不同的记录器。
#config.logger = ActiveSupport :: TaggedLogging.new(SyslogLogger.new)

#在生产中使用不同的缓存存储。
#config.cache_store =:mem_cache_store

#启用来自资产服务器的图片,样式表和JavaScript的服务。
#config.action_controller.asset_host =http://assets.example.com

#预编译其他资产。
#application.js,application.css以及app / assets文件夹中的所有非JS / CSS都已添加。
config.assets.precompile + =%w(application.css)

#忽略不良的电子邮件地址,不要引发电子邮件传递错误。
#将其设置为true,并配置电子邮件服务器以立即投递,以提高投递错误。
#config.action_mailer.raise_delivery_errors = false

#为I18n启用语言环境回退(使得任何语言环境的查找回落到
#I18n.default_locale,当翻译不能找到)。
config.i18n.fallbacks = true

#将弃用声明发送给注册的侦听器。
config.active_support.deprecation =:notify

#禁用自动刷新日志以提高性能。
#config.autoflush_log = false

#使用默认日志记录格式化程序,以便不抑制PID和时间戳记。
config.log_formatter = :: Logger :: Formatter.new
end

任何帮助将不胜感激..如果你想更多的代码看看我的github ..





谢谢!



  $ heroku日志
2013-09-16T12:54:31.548606 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in'variant'
2013-09- 16T12:54:31.548606 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in`call '
2013-09-16T12:54:31.548606 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/ application.rb:97:在`call'
2013-09-16T12:54:31.548606 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack -1.5.2 / lib / rack / lock.rb:17:在`call'
2013-09-16T12:54:31.548606 + 00:00 app [we b.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in`call'
2013-09-16T12: 54:31.548606 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in`service '
2013-09-16T12:54:31.548606 + 00:00 app [web.1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb: 138:在`service'
2013-09-16T12:54:31.548787 + 00:00 app [web.1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick /httpserver.rb:94:in`run'
2013-09-16T12:54:31.548787 + 00:00 app [web.1]:/app/vendor/ruby-2.0.0/lib/ruby/ 2.0.0 / webrick / server.rb:295:在`block in start_thread'
2013-09-16T12:54:31.574177 + 00:00 heroku [router]:at = info method = GET path = / assets /application-6aa3a38ecf886de2bf443a2b4b67ab04.js host = buyabrickonline.herokuapp.com fwd =115.188.114.182dyno = web.1 connect = 3ms service = 24ms status = 500 bytes = 334
2013-09-16T12:54:31.571790 +00:00应用[web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/s endfile.rb:133:在`call'
2013-09-16T12:54:31.571790 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties -4.0.0 / lib / rails / engine.rb:511:在`call'
2013-09-16T12:54:31.571790 + 00:00 app [web.1]:/ app / vendor / bundle / ruby / 2.0.0 / gems / rack-1.5.2 / lib / rack / handler / webrick.rb:60:在'service'
2013-09-16T12:54:31.571790 + 00:00 app [web .1]:[2013-09-16 12:54:31] ERROR ArgumentError:错误的参数数量(0表示1)
2013-09-16T12:54:31.571790 + 00:00 app [web.1 ]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in`variation'
2013-09-16T12:54:31.571790 +00:00应用[web.1]:/app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in`call'
2013-09-16T12:54:31.571790 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb :97:在`call'
2013-09-16T12:54:31.571790 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5。 2 / LIB /齿条/ lock.rb:17 :在`call'
2013-09-16T12:54:31.571790 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/ lib / rack / content_length.rb:14:在`call'中
2013-09-16T12:54:31.571790 + 00:00 app [web.1]:/app/vendor/ruby-2.0.0/lib /ruby/2.0.0/webrick/httpserver.rb:138:in`service'
2013-09-16T12:54:31.571970 + 00:00 app [web.1]:/ app / vendor / ruby​​- 2.0.0 / lib / ruby​​ / 2.0.0 / webrick / httpserver.rb:94:'run'
2013-09-16T12:54:31.571970 + 00:00 app [web.1]:/ app /vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in`block in start_thread'
2013-09-16T12:54:31.553228 + 00:00 heroku [路由器]:at = info method = GET path = / assets / application-5c6e8eba841451fd8e44660093bd224e.css host = buyabrickonline.herokuapp.com fwd =115.188.114.182dyno = web.1 connect = 3ms service = 9ms status = 500 bytes = 334
2013-09-16T12:54:31.885143 + 00:00 app [web.1]:[2013-09-16 12:54:31] ERROR ArgumentError:错误的参数数量(0表示1)
2013-09-16T12:54:31.885143 + 00:00 app [web.1]:/ app / vendor / bun dle / ruby​​ / 2.0.0 / gems / rack-1.5.2 / lib / rack / sendfile.rb:140:在`变体'中
2013-09-16T12:54:31.885143 + 00:00 app [web .1]:/app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in`call'
2013-09-16T12 :54:31.885143 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in`call'
2013-09-16T12:54:31.885143 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile .rb:133:在`call'中
2013-09-16T12:54:31.885143 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties- 4.0.0 / lib / rails / application.rb:97:在`call'
2013-09-16T12:54:31.885143 + 00:00 app [web.1]:/ app / vendor / bundle / ruby /2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in`call'
2013-09-16T12:54:31.885143 + 00:00 app [web.1] :/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in`service'
2013-09-16T12:54:31.885290 + 00:00 app [web.1]:/app/vendor/ruby-2.0.0/li b / ruby​​ / 2.0.0 / webrick / httpserver.rb:94:在`run'
2013-09-16T12:54:31.885290 + 00:00 app [web.1]:/ app / vendor / ruby -2.0.0 / lib / ruby​​ / 2.0.0 / webrick / server.rb:295:在`block in start_thread'
2013-09-16T12:54:31.885143 + 00:00 app [web.1] :/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in`call'
2013-09-16T12:54:31.885143+ 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in`service'
2013-09-16T12:54:31.892947 + 00:00 heroku [router]:at = info method = GET path = / favicon.ico host = buyabrickonline.herokuapp.com fwd =115.188.114.182dyno = web.1 connect = 2ms service = 17ms status = 500 bytes = 334
2013-09-16T12:54:35.755436 + 00:00 app [web.1]:/app/vendor/ruby-2.0.0/lib/ruby /2.0.0/webrick/httpserver.rb:138:in`service'
2013-09-16T12:54:35.755436 + 00:00 app [web.1]:[2013-09-16 12:54 :35] ERROR ArgumentError:错误的参数数量(0表示1)
2013-09-16T12:54:35.755436 + 00:00 app [web.1]:/ app / vendor / bu ndle / ruby​​ / 2.0.0 / gems / rack-1.5.2 / lib / rack / sendfile.rb:140:在`变体'中
2013-09-16T12:54:35.755436 + 00:00 app [web .1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in`call'
2013-09-16T12:54 :35.755436 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in`call'
2013-09-16T12:54:35.755436 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine .rb:511:在`call'
2013-09-16T12:54:35.755436 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties- 4.0.0 / lib / rails / application.rb:97:在`call'
2013-09-16T12:54:35.755436 + 00:00 app [web.1]:/ app / vendor / bundle / ruby /2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in`call'
2013-09-16T12:54:35.755436 + 00:00 app [web.1] :/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in`call'
2013-09-16T12:54:35.755436+ 00:00 app [web.1]:/ app / vendor / bundle / ruby​​ / 2 .0.0 / gems / rack-1.5.2 / lib / rack / handler / webrick.rb:60:在'service'中
2013-09-16T12:54:35.755629 + 00:00 app [web.1] :/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in`run'
2013-09-16T12:54:35.755629 + 00:00 app [web.1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in`block in start_thread'
2013-09-16T12:54 :35.757107 + 00:00 heroku [router]:at = info method = GET path = / favicon.ico host = buyabrickonline.herokuapp.com fwd =115.188.114.182dyno = web.1 connect = 2ms service = 10ms status = 500字节= 334
2013-09-16T12:54:43.891290 + 00:00应用[web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib /rack/lock.rb:17:in`call'
2013-09-16T12:54:43.891290 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/ gems / rack-1.5.2 / lib / rack / content_length.rb:14:在`call'
2013-09-16T12:54:43.891290 + 00:00 app [web.1]:[2013-09 -16 12:54:43] ERROR ArgumentError:错误的参数数量(0表示1)
2013-09-16T12:54:43.891290 + 00:00 app [web.1]:/ app / vendor / bundle / ruby​​ / 2.0.0 / gems / rack-1.5.2 / lib / rack / sendfile.rb:140:在`变体'中
2013-09-16T12:54:43.891290 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in`call'
2013-09-16T12 :54:43.891290 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in`调用'
2013-09-16T12:54:43.891290 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails /engine.rb:511:in`call'
2013-09-16T12:54:43.891290 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/ railties-4.0.0 / lib / rails / application.rb:97:在`call'中
2013-09-16T12:54:43.891290 + 00:00 app [web.1]:/ app / vendor / bundle /ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in`service'
2013-09-16T12:54:43.891290 + 00:00 app [ web.1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in`service'
2013-09-16T12:54:43.891475+ 00:00 app [web.1]:/ app / vendor /ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in`run'
2013-09-16T12:54:43.891475 + 00:00 app [web.1] :/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in`block in start_thread'
2013-09-16T12:54:43.895919 + 00: 00 heroku [router]:at = info method = GET path = / favicon.ico host = buyabrickonline.herokuapp.com fwd =115.188.114.182dyno = web.1 connect = 29ms service = 8ms status = 500 bytes = 334
2013-09-16T12:56:14.421956 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ ssl.rb:24:在`call'
2013-09-16T12:56:14.421956 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack -1.5.2 / lib / rack / sendfile.rb:140:在'变化'中
2013-09-16T12:56:14.421956 + 00:00 app [web.1]:/ app / vendor / bundle / ruby / 2.0.0 / gems / rack-1.5.2 / lib / rack / sendfile.rb:133:在`call'
2013-09-16T12:56:14.421956 + 00:00 app [web.1 ]:/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in`call'
2013-09 -16T12:56:14.421956 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in`调用'
2013-09-16T12:56:14.421956 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails /engine.rb:511:in`call'
2013-09-16T12:56:14.421956 + 00:00 app [web.1]:[2013-09-16 12:56:14] ERROR ArgumentError:错误的参数数量(0表示1)
2013-09-16T12:56:14.421956 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack- 1.5.2 / lib / rack / lock.rb:17:在`call'中
2013-09-16T12:56:14.421956 + 00:00 app [web.1]:/ app / vendor / bundle / ruby /2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in`service'
2013-09-16T12:56:14.421956 + 00:00 app [web。 1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in`service'
2013-09-16T12:56:14.422129 + 00: 00 app [web.1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in`run'
2013-09-16T12:56 :14.422129 + 00:00 app [web.1]:/ app / vendor / rub y-2.0.0 / lib / ruby​​ / 2.0.0 / webrick / server.rb:295:在`block in start_thread'
2013-09-16T12:56:14.423497 + 00:00 heroku [router]: at = info method = GET path = / favicon.ico host = buyabrickonline.herokuapp.com fwd =115.188.114.182dyno = web.1 connect = 1ms service = 5ms status = 500 bytes = 334
2013-09 -16T13:00:55.666613 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in`调用'
2013-09-16T13:00:55.666613 + 00:00应用[web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails /application.rb:97:in`call'
2013-09-16T13:00:55.666613 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/ rack-1.5.2 / lib / rack / handler / webrick.rb:60:在'service'中
2013-09-16T13:00:55.666613 + 00:00 app [web.1]:[2013-09 -16 13:00:55] ERROR ArgumentError:错误的参数数量(0表示1)
2013-09-16T13:00:55.666613 + 00:00 app [web.1]:/ app / vendor / bundle /ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in`variation'
2013-09-16T13:00:55。 666613 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in`call'
2013-09-16T13:00:55.666613 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl。 rb:24:在`call'
2013-09-16T13:00:55.666613 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5 .2 / lib / rack / lock.rb:17:在`call'
2013-09-16T13:00:55.666613 + 00:00 app [web.1]:/ app / vendor / bundle / ruby​​ / 2.0.0 / gems / rack-1.5.2 / lib / rack / content_length.rb:14:在`call'
2013-09-16T13:00:55.666613 + 00:00 app [web.1]: /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in`service'
2013-09-16T13:00:55.666801 + 00:00 app [ web.1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in`run'
2013-09-16T13:00:55.666801+ 00:00 app [web.1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in`block in start_thread'
2013-09 -16T13:00:56.096391 + 00:00 app [web.1]:[2013-09 -16 13:00:56] ERROR ArgumentError:错误的参数数量(0表示1)
2013-09-16T13:00:56.096391 + 00:00 app [web.1]:/ app / vendor / bundle /ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in'variable'
2013-09-16T13:00:56.096391 + 00:00 app [web。 1]:/app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in`call'
2013-09-16T13:00: 56.096391 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in`call'
2013-09-16T13:00:56.096391 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine。 rb:511:在`call'
2013-09-16T13:00:56.096391 + 00:00 app [web.1]:/app/vendor/bundle/ruby/2.0.0/gems/railties-4.0 / app / vendor / bundle / ruby​​ /。/。/ lib / rails / application.rb:97:in`call'
2013-09-16T13:00:56.096391 + 00:00 app [web.1] 2.0.0 / gems / rack-1.5.2 / lib / rack / lock.rb:17:在`call'
2013-09-16T13:00:56.096391 + 00:00 app [web.1]: /app/vendor/bundle/ruby/2.0。 0 / gems / rack-1.5.2 / lib / rack / content_length.rb:14:在`call'
2013-09-16T13:00:56.096391 + 00:00 app [web.1]:/ app /vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in`service'
2013-09-16T13:00:56.096391 + 00 :00 app [web.1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in`service'
2013-09-16T13: 00:56.096581 + 00:00 app [web.1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in`run'
2013 -09-16T13:00:56.096581 + 00:00 app [web.1]:/app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in`block in start_thread'
2013-09-16T13:00:56.100801 + 00:00 heroku [router]:at = info method = GET path = / favicon.ico host = buyabrickonline.herokuapp.com fwd =115.188.114.182 dyno = web.1 connect = 59ms service = 7ms status = 500 bytes = 334
2013-09-16T13:00:55.669488 + 00:00 heroku [router]:at = info method = GET path = / assets / application-5c6e8eba841451fd8e44660093bd224e.css host = buyabrickonline.herokuapp.com fwd =115.188.114.18 2dyno = web.1 connect = 2ms service = 5ms status = 500 bytes = 334

Webrick夹紧错误在我



p>

好的,上面这个问题与我的SSL配置有关......修正了现在的问题......



解决方案

> production.rb



注释掉这一行,因为它在其他方面似乎不必要

 #禁用Rails的静态资产服务器(Apache或nginx已经这样做)。 
#config.serve_static_assets = false

注释过此行

 #如果预编译的资源丢失,不要回退到资产管道。 
#config.assets.compile = true

而这一个

 #指定服务器用于发送文件的标头。 
#config.action_dispatch.x_sendfile_header =nill#for apache

RAILS_ENV = production rails s 现在似乎工作得很好。我还通过运行 rake assets:clobber ,我发现让Heroku在繁重的开发过程中执行预编译更容易,因为我发现在推送到Heroku之前忘记预编译并添加到git中太容易了......



希望这有助于。


I have probably wasting 4 hours trying to make this problem go away and not sure what the problem is.

Locally I have been creating my Rails Application and all the assets load properly which can be see here:

<link data-turbolinks-track="true" href="/assets/application.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/auth.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/authenications.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/customelements.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/grid.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/home.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/material.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/materials.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/project_materials.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/projects.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/registrations.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/show.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/static.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/testing.css?body=1" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/grid.css?body=1" media="all" rel="stylesheet" />
<script data-turbolinks-track="true" src="/assets/jquery.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/jquery_ujs.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/auth.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/authenications.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/grid.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/mat.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/material.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/materials.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/polygon.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/project_materials.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/projects.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/registrations.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/static.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/testing.js?body=1"></script>
<script data-turbolinks-track="true" src="/assets/application.js?body=1"></script>

So, cool it works in development mode... but then it doesn't work when I push to heroku!

<title>BuyABrick</title>
<link data-turbolinks-track="true" href="/assets/application-5c6e8eba841451fd8e44660093bd224e.css" media="all" rel="stylesheet" />
<link data-turbolinks-track="true" href="/assets/grid-fc208f1a1279c5b79eec166dc18c02f6.css" media="all" rel="stylesheet" />
<script data-turbolinks-track="true" src="/assets/application-6aa3a38ecf886de2bf443a2b4b67ab04.js"></script>
<meta content="authenticity_token" name="csrf-param" />
<meta content="aCmkfVxhDEO4PtC3AdHhLZ9smJ+9shdchBT0mkYqQvM=" name="csrf-token" />

And when I click on the

<link data-turbolinks-track="true" href="/assets/application-5c6e8eba841451fd8e44660093bd224e.css" media="all" rel="stylesheet" />

the server returns to me an internal server error (EDIT Didn't realise that the HTML screws everything up here)

So I have tried all the soultions by researching the internet for everything known to man. Here are the files that I have...

config/environment/production.rb

BuyABrick::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb.

  # Code is not reloaded between requests.
  config.cache_classes = true

  # Eager load code on boot. This eager loads most of Rails and
  # your application in memory, allowing both thread web servers
  # and those relying on copy on write to perform better.
  # Rake tasks automatically ignore this option for performance.
  config.eager_load = true

  # Full error reports are disabled and caching is turned on.
  config.consider_all_requests_local       = false
  config.action_controller.perform_caching = true

  # Enable Rack::Cache to put a simple HTTP cache in front of your application
  # Add `rack-cache` to your Gemfile before enabling this.
  # For large-scale production use, consider using a caching reverse proxy like nginx, varnish or squid.
  # config.action_dispatch.rack_cache = true

  # Disable Rails's static asset server (Apache or nginx will already do this).
  config.serve_static_assets = true

  # Compress JavaScripts and CSS.
  config.assets.js_compressor = :uglifier
  # config.assets.css_compressor = :sass

  # Do not fallback to assets pipeline if a precompiled asset is missed.
  config.assets.compile = true

  # Generate digests for assets URLs.
  config.assets.digest = true

  # Version of your assets, change this if you want to expire all your assets.
  config.assets.version = '1.0'

  # Specifies the header that your server uses for sending files.
  config.action_dispatch.x_sendfile_header = "nill" # for apache
  # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx

  # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
  config.force_ssl = true

  # Set to :debug to see everything in the log.
  config.log_level = :info

  # Prepend all log lines with the following tags.
  # config.log_tags = [ :subdomain, :uuid ]

  # Use a different logger for distributed setups.
  # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)

  # Use a different cache store in production.
  # config.cache_store = :mem_cache_store

  # Enable serving of images, stylesheets, and JavaScripts from an asset server.
  # config.action_controller.asset_host = "http://assets.example.com"

  # Precompile additional assets.
  # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
  config.assets.precompile += %w( application.css)

  # Ignore bad email addresses and do not raise email delivery errors.
  # Set this to true and configure the email server for immediate delivery to raise delivery errors.
  # config.action_mailer.raise_delivery_errors = false

  # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
  # the I18n.default_locale when a translation can not be found).
  config.i18n.fallbacks = true

  # Send deprecation notices to registered listeners.
  config.active_support.deprecation = :notify

  # Disable automatic flushing of the log to improve performance.
  # config.autoflush_log = false

  # Use default logging formatter so that PID and timestamp are not suppressed.
  config.log_formatter = ::Logger::Formatter.new
end

Any help will be appreciated.. if you want more code look into my github..

https://github.com/srizzling/BuyABrick

Thanks!

Heroku logs

$ heroku logs
2013-09-16T12:54:31.548606+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in `variation'
2013-09-16T12:54:31.548606+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in `call'
2013-09-16T12:54:31.548606+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-16T12:54:31.548606+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-16T12:54:31.548606+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-16T12:54:31.548606+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-16T12:54:31.548606+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-16T12:54:31.548787+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-16T12:54:31.548787+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-16T12:54:31.574177+00:00 heroku[router]: at=info method=GET path=/assets/application-6aa3a38ecf886de2bf443a2b4b67ab04.js host=buyabrickonline.herokuapp.com fwd="115.188.114.182" dyno=web.1 connect=3ms service=24ms status=500 bytes=334
2013-09-16T12:54:31.571790+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in `call'
2013-09-16T12:54:31.571790+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-09-16T12:54:31.571790+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-16T12:54:31.571790+00:00 app[web.1]: [2013-09-16 12:54:31] ERROR ArgumentError: wrong number of arguments (0 for 1)
2013-09-16T12:54:31.571790+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in `variation'
2013-09-16T12:54:31.571790+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in `call'
2013-09-16T12:54:31.571790+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-16T12:54:31.571790+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-16T12:54:31.571790+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-16T12:54:31.571790+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-16T12:54:31.571970+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-16T12:54:31.571970+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-16T12:54:31.553228+00:00 heroku[router]: at=info method=GET path=/assets/application-5c6e8eba841451fd8e44660093bd224e.css host=buyabrickonline.herokuapp.com fwd="115.188.114.182" dyno=web.1 connect=3ms service=9ms status=500 bytes=334
2013-09-16T12:54:31.885143+00:00 app[web.1]: [2013-09-16 12:54:31] ERROR ArgumentError: wrong number of arguments (0 for 1)
2013-09-16T12:54:31.885143+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in `variation'
2013-09-16T12:54:31.885143+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in `call'
2013-09-16T12:54:31.885143+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-09-16T12:54:31.885143+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in `call'
2013-09-16T12:54:31.885143+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-16T12:54:31.885143+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-16T12:54:31.885143+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-16T12:54:31.885290+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-16T12:54:31.885290+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-16T12:54:31.885143+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-16T12:54:31.885143+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-16T12:54:31.892947+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=buyabrickonline.herokuapp.com fwd="115.188.114.182" dyno=web.1 connect=2ms service=17ms status=500 bytes=334
2013-09-16T12:54:35.755436+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-16T12:54:35.755436+00:00 app[web.1]: [2013-09-16 12:54:35] ERROR ArgumentError: wrong number of arguments (0 for 1)
2013-09-16T12:54:35.755436+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in `variation'
2013-09-16T12:54:35.755436+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in `call'
2013-09-16T12:54:35.755436+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in `call'
2013-09-16T12:54:35.755436+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-09-16T12:54:35.755436+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-16T12:54:35.755436+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-16T12:54:35.755436+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-16T12:54:35.755436+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-16T12:54:35.755629+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-16T12:54:35.755629+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-16T12:54:35.757107+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=buyabrickonline.herokuapp.com fwd="115.188.114.182" dyno=web.1 connect=2ms service=10ms status=500 bytes=334
2013-09-16T12:54:43.891290+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-16T12:54:43.891290+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-16T12:54:43.891290+00:00 app[web.1]: [2013-09-16 12:54:43] ERROR ArgumentError: wrong number of arguments (0 for 1)
2013-09-16T12:54:43.891290+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in `variation'
2013-09-16T12:54:43.891290+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in `call'
2013-09-16T12:54:43.891290+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in `call'
2013-09-16T12:54:43.891290+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-09-16T12:54:43.891290+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-16T12:54:43.891290+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-16T12:54:43.891290+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-16T12:54:43.891475+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-16T12:54:43.891475+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-16T12:54:43.895919+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=buyabrickonline.herokuapp.com fwd="115.188.114.182" dyno=web.1 connect=29ms service=8ms status=500 bytes=334
2013-09-16T12:56:14.421956+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in `call'
2013-09-16T12:56:14.421956+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in `variation'
2013-09-16T12:56:14.421956+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in `call'
2013-09-16T12:56:14.421956+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-16T12:56:14.421956+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-16T12:56:14.421956+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-09-16T12:56:14.421956+00:00 app[web.1]: [2013-09-16 12:56:14] ERROR ArgumentError: wrong number of arguments (0 for 1)
2013-09-16T12:56:14.421956+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-16T12:56:14.421956+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-16T12:56:14.421956+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-16T12:56:14.422129+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-16T12:56:14.422129+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-16T12:56:14.423497+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=buyabrickonline.herokuapp.com fwd="115.188.114.182" dyno=web.1 connect=1ms service=5ms status=500 bytes=334
2013-09-16T13:00:55.666613+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-09-16T13:00:55.666613+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-16T13:00:55.666613+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-16T13:00:55.666613+00:00 app[web.1]: [2013-09-16 13:00:55] ERROR ArgumentError: wrong number of arguments (0 for 1)
2013-09-16T13:00:55.666613+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in `variation'
2013-09-16T13:00:55.666613+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in `call'
2013-09-16T13:00:55.666613+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in `call'
2013-09-16T13:00:55.666613+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-16T13:00:55.666613+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-16T13:00:55.666613+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-16T13:00:55.666801+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-16T13:00:55.666801+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-16T13:00:56.096391+00:00 app[web.1]: [2013-09-16 13:00:56] ERROR ArgumentError: wrong number of arguments (0 for 1)
2013-09-16T13:00:56.096391+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:140:in `variation'
2013-09-16T13:00:56.096391+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/sendfile.rb:133:in `call'
2013-09-16T13:00:56.096391+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/actionpack-4.0.0/lib/action_dispatch/middleware/ssl.rb:24:in `call'
2013-09-16T13:00:56.096391+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/engine.rb:511:in `call'
2013-09-16T13:00:56.096391+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:97:in `call'
2013-09-16T13:00:56.096391+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/lock.rb:17:in `call'
2013-09-16T13:00:56.096391+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/content_length.rb:14:in `call'
2013-09-16T13:00:56.096391+00:00 app[web.1]:    /app/vendor/bundle/ruby/2.0.0/gems/rack-1.5.2/lib/rack/handler/webrick.rb:60:in `service'
2013-09-16T13:00:56.096391+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
2013-09-16T13:00:56.096581+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
2013-09-16T13:00:56.096581+00:00 app[web.1]:    /app/vendor/ruby-2.0.0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
2013-09-16T13:00:56.100801+00:00 heroku[router]: at=info method=GET path=/favicon.ico host=buyabrickonline.herokuapp.com fwd="115.188.114.182" dyno=web.1 connect=59ms service=7ms status=500 bytes=334
2013-09-16T13:00:55.669488+00:00 heroku[router]: at=info method=GET path=/assets/application-5c6e8eba841451fd8e44660093bd224e.css host=buyabrickonline.herokuapp.com fwd="115.188.114.182" dyno=web.1 connect=2ms service=5ms status=500 bytes=334

Webrick chucking errors at me

Ok.. this issue above is do with my SSL config... fixed that now the issue is...

解决方案

So I cloned your repo and had a play around locally, here are the steps I took to make it work.

production.rb

Commented out this line as it doesn't seem necessary on other

  # Disable Rails's static asset server (Apache or nginx will already do this).
  #config.serve_static_assets = false

Commented out this line too

  # Do not fallback to assets pipeline if a precompiled asset is missed.
  #config.assets.compile = true

And this one

  # Specifies the header that your server uses for sending files.
  #config.action_dispatch.x_sendfile_header = "nill" # for apache

RAILS_ENV=production rails s now seems to be working just fine.

I also removed the precompiled assets by running rake assets:clobber, I find that it's easier to let Heroku do the precompile during heavy development as I find it's too easy to forget to precompile and add to git before pushing to Heroku...

Hope this helps.

这篇关于Rails 4,资产编译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 07:54