预编译资产失败 - 推送到Heroku

时间:2016-12-15 18:55:29

标签: ruby-on-rails heroku rubygems

我是新手,只是测试我的第一次推送

我按照rails install fest进行了测试,现在正在测试此链接中描述的过程: http://installfest.railsbridge.org/installfest/deploy_a_rails_app

我在控制台中登录了heroku并手动更新了我的gem文件。

在rake预编译中看起来像引用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'

我的宝石文件:

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]

1 个答案:

答案 0 :(得分:0)

这与Windows无关,最近更新的coffe-script-source gem 1.12.1存在问题。问题是此版本中的源文件为空。已经有一个open issue,应该尽快解决。

现在你可以将它添加到你的GemFile

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

并在推送到Heroku之前在本地计算机上运行bundle update coffee-script-source,它应该可以正常工作。