向Rails应用程序推送到heroku失败-编译失败

时间:2018-11-04 03:22:01

标签: ruby-on-rails heroku webpack deployment node-modules

尝试在Heroku上部署Rails应用程序时遇到一些困难。尝试编译时出现了这个奇怪的错误日志。我认为这与节点模块有关,但我不确定。

我完全不知道如何解释错误,将不胜感激!感谢您的阅读!

-----> Node.js app detected

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true

-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)
       engines.yarn (package.json):  unspecified (use default)

       Resolving node version 10.x...
       Downloading and installing node 10.13.0...
       Using default npm version: 6.4.1
       Resolving yarn version 1.x...
       Downloading and installing yarn (1.12.1)...
       Installed yarn 1.12.1

-----> Restoring cache
       Cached directories were not restored due to a change in version of node, npm, yarn or stack
       Module installation may take longer for this build

-----> Building dependencies
       Installing node modules (yarn.lock)
       yarn install v1.12.1
       warning package.json: No license field
       warning No license field
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       info fsevents@1.1.3: The platform "linux" is incompatible with this module.
       info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
       [3/4] Linking dependencies...
       warning "@rails/webpacker > postcss-cssnext@3.0.2" has unmet peer dependency "caniuse-lite@^1.0.30000697".
       warning " > webpack-dev-server@2.11.2" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0".
       warning "webpack-dev-server > webpack-dev-middleware@1.12.2" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
       [4/4] Building fresh packages...
       Done in 150.36s.

-----> Caching build
       - node_modules

-----> Pruning devDependencies
       yarn install v1.12.1
       warning package.json: No license field
       warning No license field
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       info fsevents@1.1.3: The platform "linux" is incompatible with this module.
       info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
       [3/4] Linking dependencies...
       warning "@rails/webpacker > postcss-cssnext@3.0.2" has unmet peer dependency "caniuse-lite@^1.0.30000697".
       warning " > webpack-dev-server@2.11.2" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0".
       warning "webpack-dev-server > webpack-dev-middleware@1.12.2" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
       [4/4] Building fresh packages...
       warning Ignored scripts due to flag.
       Done in 5.21s.

-----> Build succeeded!
 !     Unmet dependencies don't fail yarn install but may cause runtime issues
       https://github.com/npm/npm/issues/7494
-----> Ruby app detected
-----> Compiling Ruby/Rails
-----> Using Ruby version: ruby-2.3.5
-----> Installing dependencies using bundler 1.15.2
       Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
       Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
       Fetching gem metadata from https://rubygems.org/.........
       Fetching version metadata from https://rubygems.org/..
       Fetching dependency metadata from https://rubygems.org/.
       Using rake 12.3.0
       Using concurrent-ruby 1.0.5
       Using minitest 5.11.3
       Using thread_safe 0.3.6
       Using builder 3.2.3
       Using erubi 1.7.0
       Using mini_portile2 2.3.0
       Using crass 1.0.3
       Using rack 2.0.5
       Using nio4r 2.2.0
       Using websocket-extensions 0.1.3
       Using mini_mime 1.0.0
       Using coffee-script-source 1.12.2
       Using execjs 2.7.0
       Using method_source 0.9.0
       Using thor 0.20.0
       Using formtastic_i18n 0.6.0
       Using kaminari-core 1.1.1
       Using arel 8.0.0
       Using rb-fsevent 0.10.2
       Using ffi 1.9.18
       Using public_suffix 3.0.2
       Using browser 2.5.3
       Using geocoder 1.4.7
       Using referer-parser 0.3.0
       Using errbase 0.1.0
       Using user_agent_parser 2.4.1
       Using httpclient 2.8.3
       Using json 2.1.0
       Using analytics-ruby 2.0.13
       Using aws_cf_signer 0.1.3
       Using bcrypt 3.1.11
       Using bundler 1.15.2
       Using mime-types-data 3.2016.0521
       Using climate_control 0.2.0
       Using orm_adapter 0.5.0
       Using unf_ext 0.0.7.5
       Using netrc 0.11.0
       Using cocoon 1.2.11
       Using connection_pool 2.2.1
       Using dotenv 2.2.1
       Using multipart-post 2.0.0
       Using hashie 3.5.7
       Using multi_json 1.13.1
       Using jwt 1.5.6
       Using mini_magick 4.8.0
       Using multi_xml 0.6.0
       Using pg 0.21.0
       Using puma 3.11.2
       Using redis 4.0.1
       Using tilt 2.0.8
       Using slack-notifier 2.3.2
       Using i18n 0.9.3
       Using tzinfo 1.2.4
       Using nokogiri 1.8.2
       Using websocket-driver 0.6.5
       Using coffee-script 2.4.1
       Using autoprefixer-rails 7.2.5
       Using uglifier 4.1.5
       Using rack-test 0.8.2
       Using sprockets 3.7.2
       Using request_store 1.4.1
       Using appsignal 2.5.1
       Using warden 1.2.7
       Using rack-protection 2.0.1
       Using rack-proxy 0.6.3
       Using mail 2.7.0
       Using figaro 1.1.1
       Using addressable 2.5.2
       Using rb-inotify 0.9.10
       Using safely_block 0.2.1
       Using algoliasearch 1.19.1
       Using postmark 1.11.0
       Using mime-types 3.1
       Using terrapin 0.6.0
       Using unf 0.1.4
       Using faraday 0.12.2
       Using omniauth 1.8.1
       Using i18n-js 3.0.5
       Using activesupport 5.1.4
       Using loofah 2.2.1
       Using sidekiq 5.1.1
       Using algoliasearch-rails 1.20.4
       Using cocaine 0.6.0
       Using sass-listen 4.0.0
       Using domain_name 0.5.20170404
       Using oauth2 1.4.0
       Using rails-dom-testing 2.0.3
       Using globalid 0.4.1
       Using arbre 1.1.1
       Using activemodel 5.1.4
       Using jbuilder 2.7.0
       Using pundit 1.1.0
       Using rails-html-sanitizer 1.0.3
       Using sass 3.5.5
       Using ckeditor 4.2.4
       Using omniauth-oauth2 1.5.0
       Using activejob 5.1.4
       Using activerecord 5.1.4
       Using carrierwave 1.2.2
       Using http-cookie 1.0.3
       Using actionview 5.1.4
       Using sidekiq-failures 1.0.0
       Using omniauth-google-oauth2 0.5.3
       Using omniauth-linkedin-oauth2 0.2.5
       Using rest-client 2.0.2
       Using actionpack 5.1.4
       Using kaminari-actionview 1.1.1
       Using kaminari-activerecord 1.1.1
       Using polyamorous 1.3.3
       Using friendly_id 5.1.0
       Using globalize 5.1.0
       Using cloudinary 1.8.3
       Using actioncable 5.1.4
       Using actionmailer 5.1.4
       Using railties 5.1.4
       Using formtastic 3.1.5
       Using has_scope 0.7.1
       Using sprockets-rails 3.2.1
       Using simple_form 3.5.0
       Using kaminari 1.1.1
       Using ransack 1.8.7
       Using bootstrap-sass 3.3.7
       Using font-awesome-sass 4.7.0
       Using postmark-rails 0.16.0
       Using coffee-rails 4.2.2
       Using responders 2.4.0
       Using jquery-rails 4.3.1
       Using ahoy_matey 2.0.2
       Using jquery-ui-rails 6.0.1
       Using rails 5.1.4
       Using sass-rails 5.0.7
       Using webpacker 3.2.1
       Using wicked 1.3.2
       Using inherited_resources 1.8.0
       Using devise 4.4.1
       Using activeadmin 1.2.1
       Using activeadmin_quill_editor 0.1.2
       Using devise-i18n 1.6.1
       Bundle complete! 48 Gemfile dependencies, 139 gems now installed.
       Gems in the groups development and test were not installed.
       Bundled gems are installed into ./vendor/bundle.
       Bundle completed (4.60s)
       Cleaning up the bundler cache.
       Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.3). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
       The latest bundler is 1.17.1, but you are currently running 1.15.2.
       To update, run `gem install bundler`
-----> Detecting rake tasks
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       [2018-11-04T02:40:05 (process) #6617][INFO] appsignal: Loading Rails (5.1.4) integration
       [2018-11-04T02:40:05 (process) #6617][INFO] appsignal: Starting AppSignal 2.5.1 (vendor/bundle/bin/rake, Ruby 2.3.5, x86_64-linux)
       [2018-11-04T02:40:05 (process) #6617][INFO] appsignal: Installing action_cable hook
       [2018-11-04T02:40:05 (process) #6617][INFO] appsignal: Installing active_support_notifications hook
       [2018-11-04T02:40:05 (process) #6617][INFO] appsignal: Installing net_http hook
       [2018-11-04T02:40:05 (process) #6617][INFO] appsignal: Installing rake hook
       [2018-11-04T02:40:05 (process) #6617][INFO] appsignal: Installing redis hook
       [2018-11-04T02:40:05 (process) #6617][INFO] appsignal: Installing sidekiq hook
       yarn install v1.12.1
       warning package.json: No license field
       warning No license field
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       info fsevents@1.1.3: The platform "linux" is incompatible with this module.
       info "fsevents@1.1.3" is an optional dependency and failed compatibility check. Excluding it from installation.
       [3/4] Linking dependencies...
       warning "@rails/webpacker > postcss-cssnext@3.0.2" has unmet peer dependency "caniuse-lite@^1.0.30000697".
       warning " > webpack-dev-server@2.11.2" has unmet peer dependency "webpack@^2.2.0 || ^3.0.0".
       warning "webpack-dev-server > webpack-dev-middleware@1.12.2" has unmet peer dependency "webpack@^1.0.0 || ^2.0.0 || ^3.0.0".
       [4/4] Building fresh packages...
       Done in 25.45s.
       Webpacker is installed  
       Using /tmp/build_8db0b26a8a57a805bbbf230bff23e793/config/webpacker.yml file for setting up webpack paths
       Compiling…
       Compilation failed:

       node[6689]: ../src/node_file.cc:943:void node::fs::Stat(const v8::FunctionCallbackInfo<v8::Value>&): Assertion `(argc) == (4)' failed.
        1: 0x8daaa0 node::Abort() [node]
        2: 0x8dab75  [node]
        3: 0x91abea  [node]
        4: 0xb5faef  [node]
        5: 0xb60659 v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) [node]
        6: 0x1fd8ea3dbe1d 

 !
 !     Precompiling assets failed.
 !
 !     Push rejected, failed to compile Ruby app.
 !     Push failed

1 个答案:

答案 0 :(得分:0)

似乎Heroku的节点buildpack已默认升级为使用节点10: https://github.com/heroku/heroku-buildpack-nodejs/commit/4cf68e4e63698cdb56ee18737533482d99d25a74)。

如果未按照此处https://github.com/heroku/heroku-buildpack-nodejs/commit/4cf68e4e63698cdb56ee18737533482d99d25a74的指示在package.json中指定节点版本,则它可能开始使用节点10,而以前使用的是节点8。在package.json中将节点版本指定为8应该可以解决问题(并且可能开始着手升级您的应用程序以使其与节点10兼容)。