Closed bkahl closed 11 years ago
Hey Brad,
I don't really know why the split_stylesheet_link_tag
helper for some reason isn't loaded/available in your app. It is defined here: https://github.com/zweilove/css_splitter/blob/master/app/helpers/css_splitter/application_helper.rb and loaded here: https://github.com/zweilove/css_splitter/blob/master/lib/css_splitter/engine.rb#L9-L13 I have to dig a little deeper to figure out what could be wrong here.
As a workaround/quickfix I would recommend you simply do the include yourself, manually writing the code that the helper would produce. Something like this:
= stylesheet_link_tag "application", :media => "all"
/[if IE lte IE 9]
= stylesheet_link_tag "application_split2", :media => "all"
Let me know if that works for you in the meantime and I will get back to you once I know more about why the helper could not be loaded.
thanks, i already tried that.
i think the current project im working on now is more then that because i found a counter to count my selectors and its less then 4095 so the css_splitter shouldn't even be a factor, im thinking the css isn't loading in ie9 properly due to either the bootstrap sass gem overwriting some of the predefined styles.
we ended up getting control of a project from our outsourced team and they totally botched this project up so im trying to run through the entire pipeline.
i even tried bless just as a second potential option but neither have worked which is why i think it has something to do with the bootstrap gem itself, your really supposed to predefine some of your default elements before the bootstrap gem to prevent the bootstrap from overwriting some of your styles but that isn't what the previous owners of this project did.
ehhh.... this has been kind of frustrating and ive been dealing with it for the last 2 days.
but i don't think it has anything to do with your gem.
thanks for your help.
have a good weekend.
brad
On Fri, Mar 15, 2013 at 5:28 PM, Jakob Hilden notifications@github.comwrote:
Hey Brad,
I don't really know why the split_stylesheet_link_tag helper for some reason isn't loaded/available in your app. It is defined here: https://github.com/zweilove/css_splitter/blob/master/app/helpers/css_splitter/application_helper.rband loaded here: https://github.com/zweilove/css_splitter/blob/master/lib/css_splitter/engine.rb#L9-L13I have to dig a little deeper to figure out what could be wrong here.
As a workaround/quickfix I would recommend you simply do the include yourself, manually writing the code that the helper would produce. Something like this:
= stylesheet_link_tag "application", :media => "all" /[if IE lte IE 9] = stylesheet_link_tag "application_split2", :media => "all"
Let me know if that works for you in the meantime and I will get back to you once I know more about why the helper could not be loaded.
— Reply to this email directly or view it on GitHubhttps://github.com/zweilove/css_splitter/issues/11#issuecomment-14985903 .
Thanks,
Brad Kahl Software Developer M 540.314.8352
@bkahl Did you put this gem in the assets
group in your Gemfile
? If I do that, I get the same problem.
It works for me to move this gem out of assets
group.
@linjunpop That's a very good point. I added a little note to the README. Do you think that will make things more clear? https://github.com/zweilove/css_splitter/commit/ecde6b0445f07dbd39f0c28dcca74dda00126028
@bkahl Please let us know if that fixed your problem.
@bkahl any feedback? Can this issue be closed?
hey @jhilden, sorry for the late response and not closing this out, but yes, this issue is solved, therefore, I'm closing it out. thanks for your help!
@bkahl can you confirm that the issue cam from having the gem in the assets group? I've suddenly hit this (after 3 weeks of having it in production, working) on a branch where I've added active-admin. I'm still investigating but It would be nice to know if your problem was different as well and how you fixed it. Thanks.
Don't really know what the issue could be here, but from personal experience I would recommend rails_admin
over active_admin
. Maybe that won't give you any issues.
I'm running into this same issue, with the gem outside the assets group
@muskosan can you provide some more details on used versions (gem, rails, ruby, ...), error messages, etc.?
Sure,
Error: undefined method `split_stylesheet_link_tag' for #<#Class:0x007fe20d023a40:0x007fe2069c42b8>
gem v .0.4.0. Rails 3.2.19 ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin13.0]
Using the helper isn't a necessity, though it would be nice.
hmm. seems like this part is not working for you: https://github.com/zweilove/css_splitter/blob/master/lib/css_splitter/engine.rb#L9-L13 (maybe it's not working for rails3)
you can always include the helper manually in your ApplicationController
I found that when using Pow as my local Rack server, I had to restart it to get this error to go away.
I had the same issue running on ruby 2.2.2p95 and Rails 4.2.3 application.
I had to include helper CssSplitter::ApplicationHelper
in the ApplicationController
and that worked for me.
Thanks @jefigo, thank did the trick! For me this is caused by using the ember-cli-rails gem. When I remove the gem, it works fine.
I'm having an issue with trying to precompile assets for staging environment.
I'm running:
ruby 1.9.3p327 rails 3.2.13.rc2
and I've followed your steps by adding the following: 1) the css splitter gem to my GEMFILE. 2) updating the application.rb config.assets.precompile to add my newly added application_split2.css file. note i didn't add the config.assets.compress = true to the applications.rb file b/c RubyMine gave me a message saying 'cannot find compress' 3) i created a new application_split2.css.scss.split2 file within the assets pipeline and made it reference the application.css.scss file by importing it like so:
//= include 'application.css' 4) i added the method call '= split_stylesheet_link_tag "application", :media => "all"' within application.html.haml file in layouts directory like so:
%head = raw analytical.head_prepend_javascript %meta{:charset => "utf-8"} %meta{"http-equiv" => "X-UA-Compatible", :content => "IE=edge,chrome=1"} %meta{:name => "viewport", :content => "width=device-width, initial-scale=1, maximum-scale=1"} %title= content_for?(:title) ? yield(:title) : "Projectwedding" %meta{:content => "", :name => "description"} %meta{:content => "", :name => "author"} = favicon_link_tag = split_stylesheet_link_tag "application", :media => "all" = stylesheet_link_tag "print", :media => "print"
= javascript_include_tag "application" /[if lt IE 9] = javascript_include_tag "html5shiv" = csrf_meta_tags = javascript_tag "var AUTH_TOKEN = '#{form_authenticity_token}';" if protect_against_forgery? = raw analytical.head_append_javascript = dfp_helper_head = yield(:head) %body{:class=>page_class}
Steps followed after updating the files: 1) bundle install 2) RAILS_ENV=staging rake assets:precompile 3) restarted rails server
THEN got the following error when going to http://localhost:3000
NoMethodError in Home#index
What am I missing?
Your help is greatly appreciated!