【问题标题】:Bootstrap and Rails issue with Heroku DeploymentHeroku 部署的 Bootstrap 和 Rails 问题
【发布时间】:2013-04-19 22:43:12
【问题描述】:

我正在制作一个 Ruby on Rails 应用程序。我已经包含了 twitter-bootstrap rails gem。在本地测试了应用程序后,我多次尝试部署到 Heroku。我第一次遇到这个500错误:

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

我通过将此行添加到 config/environment/production.rb 文件中解决了这个初始问题。

config.assets.compile = true

现在,我正在尝试再次将我的 rails 应用程序推送到 Heroku,但是当我推送到 Heroku 时,我再次收到此 500 错误。我不知道如何解决这个问题:

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>

任何帮助将不胜感激!

这是我的 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'

我尝试了rake assets:precompile,然后上传到 Heroku,但仍然没有运气。

【问题讨论】:

    标签: ruby-on-rails ruby heroku twitter-bootstrap-rails


    【解决方案1】:

    您似乎拥有this previously reported issue。尝试添加以下 gem:

    gem 'bootstrap_helper'
    

    您也可以将此File 添加为您的助手之一。这就是该线程上大多数人所解决的问题。

    【讨论】:

      猜你喜欢
      • 2023-04-10
      • 2021-02-28
      • 2020-01-06
      • 2012-05-23
      • 2019-04-01
      • 2012-09-14
      • 2012-11-06
      • 1970-01-01
      相关资源
      最近更新 更多