jruby& rails 3.2在开发过程中编译scss非常慢

时间:2012-02-29 04:46:44

标签: ruby-on-rails-3 performance jruby jrubyonrails sass

我目前正在使用带有rails 3.2的jruby-1.6.6。

我正在使用gem 'bootstrap-sass', '~> 2.0.1'导入Twitter bootstrap作为scss。

但是在开发模式下,我通过jruby -S rails s启动应用程序,每次我在scss中稍微更改一下并触发刷新页面时,编译application.css.scss需要很长时间,我导入所有其他scss文件。

jruby-1.6.6jruby-1.6.7

所需的时间
Started GET "/playground/dashboard" for 0:0:0:0:0:0:0:1%0 at 2012-02-29 12:30:18 +0800
Processing by PlaygroundController#index as HTML
  Parameters: {"partial"=>"dashboard"}
  Rendered playground/_dashboard.erb (1.0ms)
  Rendered playground/show.html.erb within layouts/application (2.0ms)
Compiled application.css  (11540ms)  (pid 5518)
Completed 200 OK in 11660ms (Views: 11660.0ms)

MRI ruby-1.9.2-p290

所需的时间
Started GET "/playground/dashboard" for 127.0.0.1 at 2012-02-29 12:32:53 +0800
Processing by PlaygroundController#index as HTML
  Parameters: {"partial"=>"dashboard"}
  Rendered playground/_dashboard.erb (0.0ms)
  Rendered playground/show.html.erb within layouts/application (0.5ms)
Compiled application.css  (1283ms)  (pid 5674)
Completed 200 OK in 1323ms (Views: 1323.1ms)

有没有办法让我调整一下?

2 个答案:

答案 0 :(得分:2)

昨晚刚发现这对于jruby来说不是问题。但是使用jruby和bootstrap-sass时的问题。

如果你不是这种情况,那么jruby表现得很好,即使@import

中有大量的scss application.css.scss

答案 1 :(得分:1)

转到config/application.rb并更改选项:

config.assets.enabled = false