Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use of the helper bootstrap_flash doesn't work when precompiling assets #338

Closed
betjaminrichards opened this issue Aug 18, 2012 · 65 comments
Labels

Comments

@betjaminrichards
Copy link

precompiled assets and the pushed to Heroku. Now get the following error:

2012-08-18T11:09:58+00:00 app[web.1]: Started GET "/" for 74.73.245.36 at 2012-08-18 11:09:58 +0000
2012-08-18T11:09:58+00:00 app[web.1]: Processing by GroupsController#userindex as HTML
2012-08-18T11:09:58+00:00 app[web.1]: Completed 401 Unauthorized in 1ms
2012-08-18T11:09:58+00:00 heroku[router]: GET loaf.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=142ms status=302 bytes=105
2012-08-18T11:09:58+00:00 app[web.1]: 
2012-08-18T11:09:58+00:00 app[web.1]: 
2012-08-18T11:09:58+00:00 app[web.1]: Started GET "/users/sign_in" for 74.73.245.36 at 2012-08-18 11:09:58 +0000
2012-08-18T11:09:58+00:00 app[web.1]: Processing by Devise::SessionsController#new as HTML
2012-08-18T11:09:58+00:00 app[web.1]:   Rendered vendor/bundle/ruby/1.9.1/gems/devise-2.1.2/app/views/devise/shared/_links.erb (1.5ms)
2012-08-18T11:09:58+00:00 app[web.1]:   Rendered users/sessions/new.html.erb within layouts/application (24.5ms)
2012-08-18T11:09:58+00:00 app[web.1]: Completed 500 Internal Server Error in 299ms
2012-08-18T11:09:58+00:00 app[web.1]: 
2012-08-18T11:09:58+00:00 app[web.1]: ActionView::Template::Error (undefined local variable or method `bootstrap_flash' for #<#<Class:0x00000004a52130>:0x00000004a448c8>):
2012-08-18T11:09:58+00:00 app[web.1]:     104:      <div class="container">
2012-08-18T11:09:58+00:00 app[web.1]:     105:          <div class="content">
2012-08-18T11:09:58+00:00 app[web.1]:     106:      
2012-08-18T11:09:58+00:00 app[web.1]:     107:              <%= bootstrap_flash %> 
2012-08-18T11:09:58+00:00 app[web.1]:     108:          
2012-08-18T11:09:58+00:00 app[web.1]:     109:              <% if admin_signed_in? %>
2012-08-18T11:09:58+00:00 app[web.1]:     110:              <!-- Begin admin body container -->             
2012-08-18T11:09:58+00:00 app[web.1]:   app/views/layouts/application.html.erb:107:in `_app_views_layouts_application_html_erb___2965447359537743499_40278740'
2012-08-18T11:09:58+00:00 app[web.1]: 
2012-08-18T11:09:58+00:00 app[web.1]: 
@betjaminrichards
Copy link
Author

OK, I fixed this issue by copying the bootstrap_flash helper ( https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/app/helpers/bootstrap_flash_helper.rb ) and storing it locally in the app.

Would be good if it installed these into the application by default so that those who precompile avoid this issue in the future

@Sivli-Embir
Copy link

+1 "Would be good if it installed these into the application by default so that those who precompile avoid this issue in the future"

I had an issue pushing to heroku do to this. Bundled with git commit 'dd7598bf6844'

@jsantos
Copy link

jsantos commented Oct 18, 2012

+1 The same happened to me. But it was working on heroku on my earlier commits. Any explanation for this behavior?

@jpmcgrath
Copy link

+1 Just got bitten by this with a Heroku deploy. Will use workaround suggested by @betjaminrichards

Thanks.

@BBonifield
Copy link

+1. This should be reopened.

@poguez
Copy link

poguez commented Nov 17, 2012

Same problem here.

@cyberjom
Copy link

+1

1 similar comment
@christiangenco
Copy link

+1

@lenw
Copy link

lenw commented Nov 23, 2012

+1 to repoen

@lenart
Copy link

lenart commented Nov 23, 2012

👍 I'd also suggest adding instructions to include twitter-bootstrap-rails gem inside :assets group which is where I think it belongs.

@lenw
Copy link

lenw commented Nov 23, 2012

@lenart does that solve the problem ?

@lenart
Copy link

lenart commented Nov 23, 2012

No. I still needed to create a helper inside my app (copied from source).
It worked in development env (even precompiling assets) but had problems on
the production server.

On 23. nov. 2012, at 18:25, Len Weincier notifications@github.com wrote:

@lenart https://github.com/lenart does that solve the problem ?


Reply to this email directly or view it on
GitHubhttps://github.com//issues/338#issuecomment-10666803.

@RamananSharma
Copy link

Happened to me as well with 2.1.3 version of gem.
+1 to reopen

@betjaminrichards
Copy link
Author

Apologies for not responding earlier on this. I've now reopened the issue.

@swistaczek
Copy link

👍

1 similar comment
@jzmudzinski
Copy link

👍

@tibbon
Copy link

tibbon commented Dec 5, 2012

Having this problem as well. I'm looking at how to best fix it, and I'm unsure- aside from inserting it into the helpers as other people have done.

@computeus
Copy link
Contributor

+1

4 similar comments
@martinmalek
Copy link

+1

@marcusg
Copy link

marcusg commented Dec 17, 2012

+1

@matthewrossanderson
Copy link

👍

@jiehanzheng
Copy link

+1

@keikun17
Copy link
Contributor

keikun17 commented Jan 1, 2013

importing https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/app/helpers/bootstrap_flash_helper.rb to the rails app's app/helper fixed it for me. using twitter-bootstrap-rails v2.1.9

@geocha
Copy link

geocha commented Jan 8, 2013

+1

(same happend to me as i needed to precompile assets before deploying to heroku...)

@luki3k5
Copy link

luki3k5 commented Jan 12, 2013

+1

3 similar comments
@geoffgom
Copy link

+1

@supermarin
Copy link

+1

@bsides
Copy link

bsides commented Jan 17, 2013

+1

@bpartridge
Copy link

+1. Manually adding bootstrap_flash_helper did indeed solve the problem. This shouldn't need to be worked around though!

@Sivli-Embir
Copy link

I agree with @bpartridge, is there a reason there has been no movement on this? Is been over seven months, can we at least get a shout out on the Readme so people and stop tripping over this? Any other support for @lucasdavila idea?

@nick-desteffen
Copy link
Contributor

@CMToups there is already a Gem I linked to above. I think this gem should just get rid of the flash helpers, they don't provide much anyways.

@denniskeefe
Copy link

I used the bootstrap_helper workaround, but now my stylesheets don't seem to be loading, it's just all text. Anyone have a similar issue?

@tusharc
Copy link

tusharc commented Mar 18, 2013

+1 adding bootstrap flash helper solved

@willoughby
Copy link

+1 adding bootstrap flash helper fixed my heroku deploy, Thanks

@bhoormeena
Copy link

+1 adding bootstrap flash helper helped me in fixing the issue on production.
there should be some gem for this helper. manually adding is (not) good ?

@johnantoni
Copy link

had something similar when i switched over to the sass version of bootstrap. pulling this bootstrap_helper into my app cleared it https://github.com/seyhunak/twitter-bootstrap-rails/blob/master/app/helpers/bootstrap_flash_helper.rb

@rafaelcgo
Copy link

+1 adding bootstrap flash helper solved

@toadkicker
Copy link
Contributor

The gem doesn't belong in the assets group specifically because of the helpers and generators. It doesn't affect asset compilation not having it in the group. Please take a look at the teststrap app if you need to look at an implementation of the gem running on heroku.

@Tigraine
Copy link

Tigraine commented Jun 1, 2013

+1 - Copying the helper solved the issue for me too using 2.2.6

@anurag-p
Copy link

+1 - Same solution worked for me also.

@flatrocks
Copy link

After literally dozens of posts asserting the same solution (and assuming each post-er had the same problem and then had to find this thread for the solution...) perhaps a brief note about this in the README.md would be helpful.

@anurag-p
Copy link

Yes, It will be a good solution.

On Tue, Jun 18, 2013 at 6:30 PM, Tom Wilson notifications@github.comwrote:

After literally dozens of posts asserting the same solution (and assuming
each post-er had the same problem and then had to find this thread for the
solution...) perhaps a brief note about this in the README.md would be
helpful.


Reply to this email directly or view it on GitHubhttps://github.com//issues/338#issuecomment-19609320
.

Anurag Pattnaik
Mobile: +91-94371-78396

@Eunoia
Copy link

Eunoia commented Aug 26, 2013

I'm using rails 4 with the 3.0 branch, and I am still getting the undefined local variable or methodbootstrap_flash'` error.

@taras-yorku
Copy link

+1

1 similar comment
@shawnzam
Copy link

+1

ghost pushed a commit to mrug/brails4 that referenced this issue Nov 30, 2013
@brchristian
Copy link

+1

@thienhimself
Copy link

+!

@lucascaton
Copy link

+1

3 similar comments
@Zubair-D
Copy link

+1

@chadlwm
Copy link

chadlwm commented Apr 24, 2014

+1

@tp-singh
Copy link

+1

@istian
Copy link

istian commented Apr 28, 2015

also happened to me in productio, adding the bootstrap flash helper fixed it

raven-chen added a commit to raven-chen/ryeboy that referenced this issue May 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests