ruby - Rails 4 Heroku Deployment error: Precompiling assets failed - cannot import/find boostrap file -
my app works locally; however, when try deploy heroku following error:
remote: sass::syntaxerror: file 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 import not found or unreadable: bootstrap/dist/css/bootstrap. ..... remote: tasks: top => assets:precompile remote: (see full trace running task --trace) remote: ! remote: ! precompiling assets failed. remote: !
here application.scss, , gemfile files in order:
application.scss:
*= require_self *= require custom *= require template */ @import "bootstrap-sprockets"; @import "bootstrap";
gemfile:
# bundle edge rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.2.3' # specify rake version gem 'rake' # use postgresql database active record gem 'pg' # use scss stylesheets gem 'sass-rails', '~> 5.0' # use bootstrap sass? gem 'bootstrap-sass', '>= 3.3.6' # use uglifier compressor javascript assets gem 'uglifier', '>= 1.3.0' # use coffeescript .coffee assets , views gem 'coffee-rails', '~> 4.1.0' # see https://github.com/rails/execjs#readme more supported runtimes # gem 'therubyracer', platforms: :ruby # use jquery javascript library gem 'jquery-rails' # turbolinks makes following links in web application faster. read more: https://github.com/rails/turbolinks gem 'turbolinks' # build json apis ease. read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.0' # bundle exec rake doc:rails generates api under doc/api. gem 'sdoc', '~> 0.4.0', group: :doc # user authentication , registration gem 'devise' # font awesome , simple form gem 'simple_form' # 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 app server # gem 'unicorn' # use capistrano deployment # gem 'capistrano-rails', group: :development group :development, :test # call 'byebug' anywhere in code stop execution , debugger console gem 'byebug' # access irb console on exception pages or using <%= console %> in views gem 'web-console', '~> 2.0' gem 'rspec-rails' gem 'capybara' gem 'launchy' end # windows not include zoneinfo files, bundle tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
and vendor/assets folder looks this:
update - changes made application.scss not being pushed heroku. assume because when take out requires , imports, heroku precompile still seems looking (and not finding) bootstrap !
any appreciated - let me know if have missed out anything!
thanks in advance.
i remember error when used work on ror. issue has production.rb
file inside config
folder.
make sure line made true.
config.assets.initialize_on_precompile = true
rails comes bundled task compile asset manifests , other files in pipeline.
compiled assets written location specified in config.assets.prefix. default, /assets directory.
Comments
Post a Comment