Why Rails doesn't use their own technologies?

35 views
Skip to first unread message

Wins Lin

unread,
May 3, 2013, 10:04:18 AM5/3/13
to rubyonra...@googlegroups.com
I'm reading now about assets in Rails. Because I got errors on Heroku
that my assets are not pre-compiled. On local machine everything works
fine, on Heroku they are not pre-complied.

The guide says:
>> Starting with version 3.1, Rails defaults to concatenating all JavaScript
>> files into one master .js file and all CSS files into one master .css
>> file.
>> In production, Rails inserts an MD5 fingerprint into each filename so that
>> the file is cached by the web browser.

Then I decide to see Rials sites in console:
http://guides.rubyonrails.org/
http://edgeapi.rubyonrails.org/
http://edgeguides.rubyonrails.org/
http://edgeguides.rubyonrails.org/

No any fingerprints in assets names. They are not even from Sprockets
(no any ?body=1 at the end).

So why Rails offers to others (sets as defaults!) what they do not use
themselves?

--
Posted via http://www.ruby-forum.com/.

koulikoff

unread,
May 3, 2013, 2:45:23 PM5/3/13
to rubyonra...@googlegroups.com
just try
    rake assets:precompile

Robert Walker

unread,
May 3, 2013, 3:21:49 PM5/3/13
to rubyonra...@googlegroups.com
Wins Lin wrote in post #1107670:

What? Rails is using their own technologies exactly as they were
designed to be used. I don't know what you mean by the comment in your
subject line.

> I'm reading now about assets in Rails. Because I got errors on Heroku
> that my assets are not pre-compiled. On local machine everything works
> fine, on Heroku they suddenly are not pre-complied.

It's a good thing that you're finally reading the guides since it's
obvious you are not understanding the asset pipeline.

> The guide says:
>>> Starting with version 3.1, Rails defaults to concatenating all JavaScript
>>> files into one master .js file and all CSS files into one master .css
>>> file.
>>> In production, Rails inserts an MD5 fingerprint into each filename so that
>>> the file is cached by the web browser.
>>> This is part of Rails’ “fast by default” strategy as outlined by DHH
>>> in his keynote at RailsConf 2011.
Specifically you need to read:
http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets

> No any fingerprints in assets names. They are not even from Sprockets
> (no any ?body=1 at the end).

Of corse not if you haven't pre-compiled your assets for the production
environment as explained in the guide linked above.

> So why does Rails offer to others (sets as defaults!) what they do not
> use themselves?

You were operating on a false assumption.
Reply all
Reply to author
Forward
0 new messages