user2300882
user2300882

Reputation: 41

Bootstrap and Rails issue with Heroku Deployment

Im making a Ruby on Rails app. I've included the twitter-bootstrap rails gem. Having tested the app locally, I've attempted numerous times to deploy to Heroku. I first encountered this 500 error:

ActionView::Template::Error (images/apple-touch-icon-144x144-precomposed.png isn't precompiled)

I solved this initial problem, by adding this line to the config/environment/production.rb file.

config.assets.compile = true

Now, I'm trying to push my rails app to Heroku again but when I push to Heroku I'm getting this 500 error again. I have no idea how to solve this one:

ActionView::Template::Error (undefined local variable or method `bootstrap_flash' for#<#
77:         </div><!--/span-->
 79:           <%= bootstrap_flash %>
 78:         <div class="span9">
 80:           <%= yield %>
 app/views/layouts/application.html.erb:79:in `_app_views_layouts_application_html_erb___2619453860724409461_34912060'
 81:       </div>
 82:       </div>

Any help would be greatly appreciated!

This is my Gemfile:

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'pg'
gem 'devise'


# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails',   '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby

gem 'uglifier', '>= 1.0.3'
gem "therubyracer"
gem "less-rails"
gem 'twitter-bootstrap-rails', :git => 'http://github.com/seyhunak/twitter-bootstrap-rails.git'
end

gem 'jquery-rails'

I've tried rake assets:precompile and then upload to Heroku but still, no luck.

Upvotes: 4

Views: 2478

Answers (1)

fmendez
fmendez

Reputation: 7338

You seems to be having this previously reported issue. Try adding the following gem:

gem 'bootstrap_helper'

You can also add this File, as one of your helpers. That's what fixed for most of the folks on that thread.

Upvotes: 5

Related Questions