Hassanelashram

Joined

150 Experience
1 Lesson Completed
0 Questions Solved

Activity

Posted in Heroku deployment failing

I am trying to deploy this app to heroku. i get this error with the precompiling asset pipeline. I tried removing jquery from my Gem file but the error persists. log:

...
remote: Installing sass-rails 6.0.0
remote: Installing bootstrap 4.4.1
remote: Bundle complete! 20 Gemfile dependencies, 71 gems now installed.
remote: Gems in the groups development and test were not installed.
remote: Bundled gems are installed into ./vendor/bundle
remote: Post-install message from i18n:
remote:

remote: HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
remote: But that may break your application.
remote:

remote: If you are upgrading your Rails application from an older version of Rails:
remote:

remote: Please check your Rails app for 'config.i18n.fallbacks = true'.
remote: If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
remote: 'config.i18n.fallbacks = [I18n.default_locale]'.
remote: If not, fallbacks will be broken in your app by I18n 1.1.x.
remote:

remote: If you are starting a NEW Rails application, you can ignore this notice.
remote:

remote: For more info see:
remote: https://github.com/svenfuchs/i18n/releases/tag/v1.1.0
remote:

remote: Post-install message from paperclip:
remote: ##################################################
remote: # NOTE FOR UPGRADING FROM 4.3.0 OR EARLIER #
remote: ##################################################
remote:

remote: Paperclip is now compatible with aws-sdk >= 2.0.0.
remote:

remote: If you are using S3 storage, aws-sdk >= 2.0.0 requires you to make a few small
remote: changes:
remote:

remote: * You must set the s3_region
remote: * If you are explicitly setting permissions anywhere, such as in an initializer,
remote: note that the format of the permissions changed from using an underscore to
remote: using a hyphen. For example, :public_read needs to be changed to
remote: public-read.
remote:

remote: For a walkthrough of upgrading from 4 to 5 and aws-sdk >= 2.0 you can watch
remote: http://rubythursday.com/episodes/ruby-snack-27-upgrade-paperclip-and-aws-sdk-in-prep-for-rails-5
remote: Bundle completed (201.79s)
remote: Cleaning up the bundler cache.
remote: The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java.
remote: -----> Installing node-v10.15.3-linux-x64
remote: -----> Installing yarn-v1.16.0
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: yarn install v1.16.0
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: info fsevents@1.2.11: The platform "linux" is incompatible with this module.
remote: info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies...
remote: warning " > webpack-dev-server@3.10.1" has unmet peer dependency "webpack@4.0.0 || 5.0.0".
remote: warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@4.0.0".
remote: [4/4] Building fresh packages...
remote: Done in 22.87s.
remote: yarn install v1.16.0
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: info fsevents@1.2.11: The platform "linux" is incompatible with this module.
remote: info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies...
remote: warning " > webpack-dev-server@3.10.1" has unmet peer dependency "webpack@4.0.0 || 5.0.0".
remote: warning "webpack-dev-server > webpack-dev-middleware@3.7.2" has unmet peer dependency "webpack@4.0.0".
remote: [4/4] Building fresh packages...
remote: Done in 4.99s.
remote: I, [2020-02-01T17:00:57.359431 #1789] INFO -- : Writing /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/public/assets/manifest-cadda289ef9c70eaa0879a36e6263cb33f7523a16b3ef862e0b8609cdc2bdab1.js
remote: I, [2020-02-01T17:00:57.360167 #1789] INFO -- : Writing /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/public/assets/manifest-cadda289ef9c70eaa0879a36e6263cb33f7523a16b3ef862e0b8609cdc2bdab1.js.gz
remote: I, [2020-02-01T17:00:57.361753 #1789] INFO -- : Writing /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/public/assets/jumbo-5e6e2f89b0d4b9202695b50c7ec76d6bf3fc95738bbe4e0d6215f671d270aed5.jpg
remote: I, [2020-02-01T17:00:57.367166 #1789] INFO -- : Writing /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/public/assets/application-0d811fde68f44a2659d7cfeb78037b71d64cc26f7043db7ba50822feb5ad7db3.css
remote: I, [2020-02-01T17:00:57.369678 #1789] INFO -- : Writing /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/public/assets/application-0d811fde68f44a2659d7cfeb78037b71d64cc26f7043db7ba50822feb5ad7db3.css.gz
remote: Compiling...
remote: Compilation failed:
remote: ModuleNotFoundError: Module not found: Error: Can't resolve 'jquery' in '/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/packs
remote: at factory.create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/lib/Compilation.js:925:10)
remote: at factory (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/lib/NormalModuleFactory.js:401:22)
remote: at resolver (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/lib/NormalModuleFactory.js:130:21)
remote: at asyncLib.parallel (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/lib/NormalModuleFactory.js:224:22)
remote: at /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/neo-async/async.js:2830:7
remote: at /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/neo-async/async.js:6877:13
remote: at normalResolver.resolve (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/lib/NormalModuleFactory.js:214:25)
remote: at doResolve (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:213:14)
remote: at hook.callAsync (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
remote: at _fn0 (eval at create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1)
remote: at resolver.doResolve (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7)
remote: at hook.callAsync (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
remote: at _fn0 (eval at create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1)
remote: at hook.callAsync (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
remote: at _fn0 (eval at create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/tapable/lib/HookCodeFactory.js:33:10), :27:1)
remote: at resolver.doResolve (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43)
remote: at hook.callAsync (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
remote: at _fn41 (eval at create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/tapable/lib/HookCodeFactory.js:33:10), :28:1)
remote: at resolver.doResolve (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/ModuleKindPlugin.js:30:40)
remote: at hook.callAsync (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
remote: at _fn0 (eval at create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1)
remote: at hook.callAsync (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
remote: at _fn1 (eval at create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/tapable/lib/HookCodeFactory.js:33:10), :16:1)
remote: at args (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/forEachBail.js:30:14)
remote: at hook.callAsync (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
remote: at _fn0 (eval at create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1)
remote: at resolver.doResolve (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7)
remote: at hook.callAsync (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
remote: at _fn0 (eval at create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1)
remote: at hook.callAsync (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
remote: at _fn0 (eval at create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/tapable/lib/HookCodeFactory.js:33:10), :27:1)
remote: at resolver.doResolve (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43)
remote: at hook.callAsync (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
remote: at _fn42 (eval at create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/tapable/lib/HookCodeFactory.js:33:10), :16:1)
remote: at hook.callAsync (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/webpack/node_modules/enhanced-resolve/lib/Resolver.js:285:5)
remote: at _fn0 (eval at create (/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/tapable/lib/HookCodeFactory.js:33:10), :27:1)
remote: resolve 'jquery' in '/tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/packs'
remote: Parsed request is a module
remote: using description file: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/package.json (relative path: ./app/javascript/packs)
remote: Field 'browser' doesn't contain a valid alias configuration
remote: resolve as module
remote: looking for modules in /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript
remote: using description file: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/package.json (relative path: ./app/javascript)
remote: Field 'browser' doesn't contain a valid alias configuration
remote: using description file: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/package.json (relative path: ./app/javascript/jquery)
remote: no extension
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery doesn't exist
remote: .mjs
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.mjs doesn't exist
remote: .js
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.js doesn't exist
remote: .sass
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.sass doesn't exist
remote: .scss
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.scss doesn't exist
remote: .css
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.css doesn't exist
remote: .module.sass
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.module.sass doesn't exist
remote: .module.scss
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.module.scss doesn't exist
remote: .module.css
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.module.css doesn't exist
remote: .png
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.png doesn't exist
remote: .svg
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.svg doesn't exist
remote: .gif
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.gif doesn't exist
remote: .jpeg
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.jpeg doesn't exist
remote: .jpg
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery.jpg doesn't exist
remote: as directory
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/jquery doesn't exist
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/packs/node_modules doesn't exist or is not a directory
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/javascript/node_modules doesn't exist or is not a directory
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/app/node_modules doesn't exist or is not a directory
remote: /tmp/node_modules doesn't exist or is not a directory
remote: /node_modules doesn't exist or is not a directory
remote: looking for modules in /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules
remote: using description file: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/package.json (relative path: ./node_modules)
remote: Field 'browser' doesn't contain a valid alias configuration
remote: using description file: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/package.json (relative path: ./node_modules/jquery)
remote: no extension
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery doesn't exist
remote: .mjs
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.mjs doesn't exist
remote: .js
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.js doesn't exist
remote: .sass
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.sass doesn't exist
remote: .scss
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.scss doesn't exist
remote: .css
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.css doesn't exist
remote: .module.sass
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.module.sass doesn't exist
remote: .module.scss
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.module.scss doesn't exist
remote: .module.css
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.module.css doesn't exist
remote: .png
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.png doesn't exist
remote: .svg
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.svg doesn't exist
remote: .gif
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.gif doesn't exist
remote: .jpeg
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.jpeg doesn't exist
remote: .jpg
remote: Field 'browser' doesn't contain a valid alias configuration
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery.jpg doesn't exist
remote: as directory
remote: /tmp/build_76a7760f35cf1fa7ba2c91624cad2766/node_modules/jquery doesn't exist
remote:

remote:
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 unige.
remote:
To https://git.heroku.com/unige.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/unige.git'
Gemfile:

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby '2.6.5'

Bundle edge Rails instead: gem 'rails', github: 'rails/rails'

gem 'rails', '~> 6.0.2', '>= 6.0.2.1'

Use sqlite3 as the database for Active Record

gem 'pg'

Use Puma as the app server

gem 'puma', '~> 4.1'

Use SCSS for stylesheets

gem 'sass-rails', '>= 6'

Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker

gem 'webpacker', '~> 4.0'

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.7'

Use Redis adapter to run Action Cable in production

gem 'redis', '~> 4.0'

Use Active Model has_secure_password

gem 'bcrypt', '~> 3.1.7'

Use Active Storage variant

gem 'image_processing', '~> 1.2'

Reduces boot times through caching; required in config/boot.rb

gem 'bootsnap', '>= 1.4.2', require: false

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
end

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end

group :test do
# Adds support for Capybara system testing and selenium driver
gem 'capybara', '>= 2.15'
gem 'selenium-webdriver'
# Easy installation and use of web drivers to run system tests with browsers
gem 'webdrivers'
end

Windows does not include zoneinfo files, so bundle the tzinfo-data gem

gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'devise'
gem 'bootstrap'
gem "paperclip", "~> 6.0.0"
gem 'jquery-rails'
here is my application.html.erb: (because it has the jquery and bootstrap links)

<!DOCTYPE html>


Practice
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
<script src="https://kit.fontawesome.com/579c92a99f.js" crossorigin="anonymous"></script>



<%= notice %>
<div class="alert-success" >
  <%= alert %>
</div>
<%= yield %>


<script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script>



Have i missed something? do i need to require jquery in my javascript asset folder ?

logo Created with Sketch.

Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

© 2023 GoRails, LLC. All rights reserved.