加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

ruby-on-rails – Heroku部署中的Bootstrap和Rails问题

发布时间:2020-12-17 02:38:27 所属栏目:百科 来源:网络整理
导读:我正在制作 Ruby on Rails应用程序.我已经包含了twitter-bootstrap rails gem.在本地测试了应用程序后,我尝试了多次部署到Heroku.我第一次遇到这500错误: ActionView::Template::Error (images/apple-touch-icon-144x144-precomposed.png isn't precompiled
我正在制作 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资产:预编译然后上传到Heroku但仍然没有运气.

解决方法

你似乎有 this previously reported issue.尝试添加以下gem:

gem 'bootstrap_helper'

您也可以添加此File作为您的助手之一.对于那个线程上的大多数人来说,这就是固定的.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读