Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Precompiled assets cause ruby to crash on development mode #3839

Closed
jpon91 opened this Issue · 6 comments

4 participants

@jpon91

Whenever you precompile your assets using the rake assets:precompile command, assets are compiled to public/assets directory, and when working in production environment everything works ok, but when running rails server in dvelopment mode, if you refresh the page a few times you will get a Ruby interpreter(CUI) 1.9.2p180 [i386-mingw32] has stopped working error message and the server will crash, i do not know why this happens, but if you delete the public/assets directory the problem disapears. If the public/assets folder exists each time you reload the page the asset pipeline gives a 304 not modified message but after the third or fourth time the server will crash after giving two or three of the the precompiled files 304 message, meaning it crashed in the middle of serving a 304 message, or validating that the file had not change, a solution to this problem is setting <%= stylesheet_link_tag "application", :debug => false %> and <%= javascript_include_tag "application", :debug => false %> indicating that debug mode is not used, this way the asset pipeline will only serve the files cancatenating them, and will not check for changes in them. This is probably a bug in sprockets method of serving assets and validating their current state. Anxious to hear a response on this topic

@guilleiguaran

Can you try with 1.9.2p290?

I couldn't reproduce your error.

@bigbento

Hello, I've been able to produce this error as well, when trying to use the Sprockets helpers in assets. Here's a way to reproduce with a brand new Rails app:

rails new foo && \
cd foo && \
mkdir app/assets/pages && \
echo '<%= stylesheet_link_tag "application" %>' > app/assets/pages/foo.html.erb && \
rake assets:precompile --trace

You can see the output here: https://gist.github.com/2048741

As @jpon91 states, the issue goes away when you specify the debug mode, because the helper doesn't go looking for the params that aren't there (as no controllers are loaded with the rake task)

I haven't dug into it much more deeply than that, but I'll try and sort it out and submit a fix/pull request.

@arunagw
Collaborator

can you give a try with latest version of rails?

@arunagw
Collaborator

I would like to close this issue here. Please feel free to reopen this if issue still exists.

Cheers,
Arun

@arunagw arunagw closed this
@guilleiguaran

if still happening please post it in sprockets-rails issue tracker instead of Rails one

@arunagw
Collaborator

thanks @guilleiguaran :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.