ActionView :: Template :: Error(资产管道中不存在资产“bootstrap.min.js”。):

时间:2017-06-02 22:03:09

标签: ruby-on-rails heroku

我正在用Rails编写一个简单的平台。我已经在Heroku中部署了它。我在本地测试它,它可以工作,但在Heroku我有这个错误:ActionView::Template::Error (The asset "bootstrap.min.js" is not present in the asset pipeline.): :(

我已经尝试了一切,但错误没有发生。你怎么看?我能做什么?谢谢你的帮助!

PD: 我的assets.rb文件:

# Be sure to restart your server when you modify this file.

# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = '1.0'

# Add additional assets to the asset load path.
# Rails.application.config.assets.paths << Emoji.images_path
# Add Yarn node_modules folder to the asset load path.
Rails.application.config.assets.paths << Rails.root.join('node_modules')

# CSS
Rails.application.config.assets.precompile += %w( bootstrap.min.css )
Rails.application.config.assets.precompile += %w( icons.scss )
Rails.application.config.assets.precompile += %w( main.css )
Rails.application.config.assets.precompile += %w( responsive.css )

# JS
Rails.application.config.assets.precompile += %w( app.js common.js home2.js )
Rails.application.config.assets.precompile += %w( jquery-2.1.3.js )
Rails.application.config.assets.precompile += %w( bootstrap.min.js )

# Fuentes
Rails.application.config.assets.paths << Rails.root.join("app", "assets", "fonts")

1 个答案:

答案 0 :(得分:0)

我只是将这些行添加到application.js:

//= require bootstrap.min
//= require jquery-2.1.3
//= require app
//= require common
//= require home2

我删除了对index.html.erb

中文件的直接引用