我的应用程序在本地运行;但是,当我尝试将其部署到Heroku时,出现以下错误:
remote: Sass::SyntaxError: File to import not found or unreadable: bootstrap/dist/css/bootstrap.
remote: (sass):18
.....
remote: /tmp/build_c0c6ec9ea8e1ea183aca6e660993c246/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.0.1/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
remote:
Sass::SyntaxError: File to import not found or unreadable: bootstrap/dist/css/bootstrap.
.....
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
remote: !
remote: ! Precompiling assets failed.
remote: !
以下是application.scss和Gemfile文件的顺序:
application.scss:
*= require_self
*= require custom
*= require template
*/
@import "bootstrap-sprockets";
@import "bootstrap";
宝石文件:
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.3'
# Specify Rake version
gem 'rake'
# Use postgresql as the database for Active Record
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use bootstrap sass?
gem 'bootstrap-sass', '>= 3.3.6'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# For user authentication and registration
gem 'devise'
# Font Awesome and simple form
gem 'simple_form'
# For static pages
gem 'high_voltage'
gem 'paperclip', '~> 3.5.3' # github: 'thoughtbot/paperclip
gem 'closure_tree'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
gem 'rspec-rails'
gem 'capybara'
gem 'launchy'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
更新-对我的application.scss所做的更改未推送到Heroku。我以为是因为即使我取出所有需求和导入,Heroku预编译似乎仍然在寻找(而不是寻找)bootstrap!
感谢您的帮助-如果我错过了任何事情,请通知我!
提前致谢。
问题是我在开发分支上进行更改并尝试将其推送,git push heroku master
但实际上没有意识到(实际上是“ NEWBIES TAKE NOTE”),但实际上只有从本地master分支进行推送。
因此,我将所有更改合并到主分支中并进行了推送。问题解决了。
如果您的设置类似于我的设置,请注意其他答案,因为我确信接受这些建议意味着我避免了代码中的其他错误。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句