简体   繁体   English

慢资产红宝石1.9.3,macos,rails 3.2

[英]Slow assets ruby 1.9.3, macos, rails 3.2

Im have a really weird issue, my assets served really slow in development(10 sec per file), thia happens only in Chrome(17.0.963.79). 我有一个非常奇怪的问题,我的资产在开发中的速度非常慢(每个文件10秒),而这只发生在Chrome(17.0.963.79)中。 In Firefox all works just fine. 在Firefox中一切正常。 My setup: 我的设置:

  • RVM RVM
  • Ruby-1.9.3@p125 Ruby-1.9.3@p125
  • Rails 3.2.0 Rails 3.2.0
  • Mac OS 10.7.3 I have tried switch from webrick to mongrel and thin , using rails-dev-tweaks gem , set cache classes to true and false. Mac OS 10.7.3我尝试使用rails-dev-tweaks gemwebrick切换到mongrelthin ,将缓存类设置为true和false。 All this didnt help, im stuck why it's work slow only in chrome and not in firefox? 这一切都没有帮助,我坚持为什么它的工作只在chrome中运行缓慢而不在Firefox中? Also this is fresh setup of OS, maybe im missing something, thanks! 这也是操作系统的新设置,也许我错过了一些东西,谢谢!

UPD. UPD。 If this initial request(eg from new tab) all goes smooth. 如果这个初始请求(例如来自新标签)都顺利进行。 Request take near 2 minute only if im refreshing page. 如果我正在刷新页面请求接近2分钟。 I just can't wrap my head around this issue :( 我只是无法绕过这个问题:(

This seems to have something to do with name resolution. 这似乎与名称解析有关。

Using (chrome) and 使用(chrome)和

  • localhost:3000/ -- great performance localhost:3000 / - 性能很好
  • 127.0.0.1:3000/ -- great performance 127.0.0.1:3000/ - 出色的表现
  • hostname.local:3000/ - Terrible performance as you describe hostname.local:3000 / - 你描述的糟糕表现

This is unfortunate for me, as I have an alias set up in /etc/hosts to point to 127.0.0.1 that affects how the page gets displayed. 这对我来说很不幸,因为我在/ etc / hosts中设置了一个别名,指向127.0.0.1,它会影响页面的显示方式。 So no testing of that in chrome. 所以没有测试铬。

I had the same problem. 我有同样的问题。 Try setting config.assets.debug = false in development.rb . 尝试在development.rb设置config.assets.debug = false It helped in my case. 它对我的情况有帮助。

We ran into this issue and solved it through using a pow server since it resolves to port 80. 我们遇到了这个问题并通过使用pow服务器解决了它,因为它解析为端口80。

To install pow 安装电源

curl get.pow.cx | sh

Here is a link to the source for the paranoid. 这是偏执狂来源链接

Hope that helps. 希望有所帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails-将ruby升级到1.9.3并将rails升级到3.2后没有上传到heroku - Rails - Not uploading to heroku after upgrading ruby to 1.9.3 and rails to 3.2 MySQL2 / Ruby 1.9.3 / Rails上的分段错误3.2 - Segmentation Fault on MySQL2 / Ruby 1.9.3 / Rails 3.2 Rails 3.2 + Ruby 1.9.3,created_at以错误的时区返回 - Rails 3.2 + Ruby 1.9.3, created_at returns with wrong timezone 如何使用RVM将Rails 3.2应用程序从ruby 1.9.3升级到ruby 2.1.5 - How do I upgrade a rails 3.2 app from ruby 1.9.3 to ruby 2.1.5 using rvm 无法在Rails 3.2 Ruby 1.9.3-p0中安装水银导轨 - Could not install mercury-rails in Rails 3.2 Ruby 1.9.3-p0 在US-ASCII问题中使用ruby 1.9.3的Rails 3.2无效字节序列 - Rails 3.2 with ruby 1.9.3 invalid byte sequence in US-ASCII issue 升级到Rails 3.2和ruby 1.9.3后,堆栈级别太深了 - Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 在为Rails 3.2 app进行捆绑安装时,使用ruby 1.9.3进行分段错误 - Segmentation fault error with ruby 1.9.3 when doing bundle install for Rails 3.2 app Ruby 1.9.3,Rails 3.2.12,OSX Lion-引导命令行脚本的Rails缓慢 - Ruby 1.9.3, Rails 3.2.12, OSX Lion - bootstrapping Rails for command-line scripts slow Rails 3.2预压缩所选资产 - Rails 3.2 precompressing selected assets
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM