3 votes

La précompilation des actifs a échoué - Push to Heroku

Je suis nouveau dans ce domaine, je viens de tester ma première poussée.

J'ai suivi la procédure d'installation de rails et je teste maintenant la procédure décrite dans ce lien : http://installfest.railsbridge.org/installfest/deploy_a_rails_app

Je me suis connecté à heroku dans la console et j'ai mis à jour mon fichier gem avant.

On dirait que quelque chose dans la précompilation de rake fait référence à CoffeeScript ?

C:\Sites\railsbridge\test_app>git push heroku master
Counting objects: 112, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (98/98), done.
Writing objects: 100% (112/112), 24.29 KiB | 0 bytes/s, done.
Total 112 (delta 7), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.6
remote: ###### WARNING:
remote:        Removing `Gemfile.lock` because it was generated on Windows.
remote:        Bundler will do a full resolve so native gems are handled properly.
remote:        This may result in unexpected gem versions being used in your app.
remote:        In rare occasions Bundler may not be able to resolve your dependencies at all.
remote:        https://devcenter.heroku.com/articles/bundler-windows-gemfile
remote:
remote: -----> Installing dependencies using bundler 1.13.6
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
remote:        Fetching gem metadata from https://rubygems.org/..........
remote:        Fetching version metadata from https://rubygems.org/..
remote:        Fetching dependency metadata from https://rubygems.org/.
remote:        Resolving dependencies...
remote:        Installing i18n 0.7.0
remote:        Installing rake 12.0.0
remote:        Installing concurrent-ruby 1.0.2
remote:        Installing minitest 5.10.1
remote:        Installing thread_safe 0.3.5
remote:        Installing builder 3.2.2
remote:        Installing erubis 2.7.0
remote:        Installing mini_portile2 2.1.0
remote:        Installing rack 2.0.1
remote:        Installing nio4r 1.2.1 with native extensions
remote:        Installing websocket-extensions 0.1.2
remote:        Installing mime-types-data 3.2016.0521
remote:        Using bundler 1.13.6
remote:        Installing coffee-script-source 1.12.1
remote:        Installing arel 7.1.4
remote:        Installing execjs 2.7.0
remote:        Installing method_source 0.8.2
remote:        Installing multi_json 1.12.1
remote:        Installing thor 0.19.4
remote:        Installing pg 0.19.0 with native extensions
remote:        Installing puma 3.6.2 with native extensions
remote:        Installing sass 3.4.22
remote:        Installing tilt 2.0.5
remote:        Installing turbolinks-source 5.0.0
remote:        Installing tzinfo 1.2.2
remote:        Installing nokogiri 1.6.8.1 with native extensions
remote:        Installing rack-test 0.6.3
remote:        Installing sprockets 3.7.0
remote:        Installing websocket-driver 0.6.4 with native extensions
remote:        Installing mime-types 3.1
remote:        Installing coffee-script 2.4.1
remote:        Installing uglifier 3.0.4
remote:        Installing turbolinks 5.0.1
remote:        Installing activesupport 5.0.0.1
remote:        Installing globalid 0.3.7
remote:        Installing activemodel 5.0.0.1
remote:        Installing jbuilder 2.6.1
remote:        Installing rails-dom-testing 2.0.1
remote:        Installing activejob 5.0.0.1
remote:        Installing loofah 2.0.3
remote:        Installing rails-html-sanitizer 1.0.3
remote:        Installing activerecord 5.0.0.1
remote:        Installing actionview 5.0.0.1
remote:        Installing actionpack 5.0.0.1
remote:        Installing actioncable 5.0.0.1
remote:        Installing railties 5.0.0.1
remote:        Installing sprockets-rails 3.2.0
remote:        Installing coffee-rails 4.2.1
remote:        Installing jquery-rails 4.2.1
remote:        Installing sass-rails 5.0.6
remote:        Installing mail 2.6.4
remote:        Installing actionmailer 5.0.0.1
remote:        Installing rails 5.0.0.1
remote:        Bundle complete! 13 Gemfile dependencies, 53 gems now installed.
remote:        Gems in the groups development and test were not installed.
remote:        Bundled gems are installed into ./vendor/bundle.
remote:        Bundle completed (147.97s)
remote:        Cleaning up the bundler cache.
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote:        Running: rake assets:precompile
remote:        rake aborted!
remote:        ExecJS::ProgramError: ReferenceError: CoffeeScript is not defined
remote:        compile ((execjs):10:18)
remote:        eval (eval at <anonymous> ((execjs):24:8), <anonymous>:1:10)
remote:        print ((execjs):24:8)
remote:        (execjs):30:14
remote:        print ((execjs):1:102)
remote:        Object.<anonymous> ((execjs):1:120)
remote:        Module._compile (module.js:456:26)
remote:        Object.Module._extensions..js (module.js:474:10)
remote:        Module.load (module.js:356:32)
remote:        Function.Module._load (module.js:312:12)
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:39:in `exec'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:21:in `eval'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/execjs-2.7.0/lib/execjs/external_runtime.rb:46:in `call'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/coffee-script-2.4.1/lib/coffee_script.rb:78:in `compile'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/coffee_script_processor.rb:21:in `block in call'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cache.rb:85:in `fetch'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/coffee_script_processor.rb:20:in `call'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:60:in `block in load'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:44:in `load'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `yield'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `load'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/bundle.rb:23:in `block in call'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/utils.rb:196:in `dfs'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/bundle.rb:24:in `call'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:60:in `block in load'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:317:in `fetch_asset_from_dependency_cache'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/loader.rb:44:in `load'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `yield'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/cached_environment.rb:47:in `load'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/base.rb:66:in `find_asset'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/base.rb:73:in `find_all_linked_assets'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:142:in `block in find'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:212:in `block in stat_directory'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `each'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:209:in `stat_directory'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/path_utils.rb:227:in `stat_tree'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:105:in `each'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:105:in `block in logical_paths'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:104:in `each'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/legacy.rb:104:in `logical_paths'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:140:in `find'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/sprockets/manifest.rb:185:in `compile'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-3.7.0/lib/rake/sprocketstask.rb:147:in `with_logger'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/sprockets-rails-3.2.0/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
remote:        /tmp/build_bd4e65eaf28723691c98b74ee9ee590c/vendor/bundle/ruby/2.2.0/gems/rake-12.0.0/exe/rake:27:in `<top (required)>'
remote:        Tasks: TOP => assets:precompile
remote:        (See full trace by running task with --trace)
remote:  !
remote:  !     Precompiling assets failed.
remote:  !
remote:  !     Push rejected, failed to compile Ruby app.
remote:
remote:  !     Push failed
remote: Verifying deploy....
remote:
remote: !       Push rejected to ancient-lake-90787.
remote:
To https://git.heroku.com/ancient-lake-90787.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/ancient-lake-90787.git'

Mon fichier Gem :

source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
# Use sqlite3 as the database for Active Record
group :development, :test do
  gem 'sqlite3'
end

group :production do
  gem 'pg'
end
# Use Puma as the app server
gem 'puma', '~> 3.0'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.2'
# 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 navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
gem 'turbolinks', '~> 5'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.5'
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 3.0'
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# 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', platform: :mri
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
  gem 'web-console'
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

0voto

Hossam Khamis Points 596

Cela n'est pas lié à Windows, il y a un problème dans coffe-script-source gem 1.12.1 qui a été récemment mis à jour. Le problème est que le fichier source de cette version est vide. problème ouvert et il devrait être corrigé bientôt.

Pour l'instant, vous pouvez ajouter ceci à votre GemFile

gem 'coffee-script-source', '= 1.11.1'

et exécuter bundle update coffee-script-source dans votre machine locale avant de la pousser vers Heroku et cela devrait fonctionner.

Prograide.com

Prograide est une communauté de développeurs qui cherche à élargir la connaissance de la programmation au-delà de l'anglais.
Pour cela nous avons les plus grands doutes résolus en français et vous pouvez aussi poser vos propres questions ou résoudre celles des autres.

Powered by:

X