Cannot Deploy Rails App with Webpacker on Heroku - ruby-on-rails

I have upgraded a Rails 5 app to Rails 6 and also migrated all JS files from the assets pipeline to Webpacker. In development everything works fine. However, when I push the code to production I get an error when I attempt a page load.
I am using heroku for production. The build process successfully completes.
Here is my error:
ActionView::Template::Error (Webpacker can't find application in /app/public/packs/manifest.json.
Possible causes:
2019-10-24T07:23:04.376725+00:00 app[web.2]: 1. You want to set webpacker.yml value of compile to true for your environment
2019-10-24T07:23:04.376728+00:00 app[web.2]: unless you are using the `webpack -w` or the webpack-dev-server.
2019-10-24T07:23:04.376730+00:00 app[web.2]: 2. webpack has not yet re-run to reflect updates.
2019-10-24T07:23:04.376732+00:00 app[web.2]: 3. You have misconfigured Webpacker's config/webpacker.yml file.
2019-10-24T07:23:04.376734+00:00 app[web.2]: 4. Your webpack configuration is not creating a manifest.
2019-10-24T07:23:04.376736+00:00 app[web.2]: Your manifest contains:
2019-10-24T07:23:04.376739+00:00 app[web.2]: {
2019-10-24T07:23:04.376741+00:00 app[web.2]: }
2019-10-24T07:23:04.376742+00:00 app[web.2]: ):
Here is my package.json file
{
"name": "manager",
"private": true,
"dependencies": {
"#rails/activestorage": "^6.0.0",
"#rails/ujs": "^6.0.0",
"#rails/webpacker": "^4.0.7",
"bootstrap": "^4.3.1",
"fullcalendar": "^3.10.1",
"jquery": "^3.4.1",
"jquery-ui": "^1.12.1",
"latest-version": "^5.1.0",
"moment": "^2.24.0",
"popper.js": "^1.16.0",
"qtip2": "^3.0.3",
"scheduler": "^0.16.2",
"tempusdominus-bootstrap-4": "^5.1.2"
},
"devDependencies": {
"webpack-dev-server": "^3.8.2"
}
}
I'm completely lost. I've tried recompiling assets, changing webpacker compile to true for production. I've also tried running yarn install --check-files but everything runs successfully. I have also tried completely reinstalling webpacker with the following command: bundle exec rake webpacker:install then pushing the updated code to production but I still get the same error.
Here are my heroku build logs
Delta compression using up to 2 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (7/7), 1.01 KiB | 1.01 MiB/s, done.
Total 7 (delta 6), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote: NODE_VERBOSE=false
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote: engines.yarn (package.json): unspecified (use default)
remote:
remote: Resolving node version 10.x...
remote: Downloading and installing node 10.17.0...
remote: Using default npm version: 6.11.3
remote: Resolving yarn version 1.x...
remote: Downloading and installing yarn (1.19.1)...
remote: Installed yarn 1.19.1
remote:
remote: -----> Restoring cache
remote: - node_modules
remote:
remote: -----> Installing dependencies
remote: Installing node modules (yarn.lock)
remote: yarn install v1.19.1
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: info fsevents#1.2.9: The platform "linux" is incompatible with this module.
remote: info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies...
remote: warning " > tempusdominus-bootstrap-4#5.1.2" has unmet peer dependency "moment-timezone#^0.5.11".
remote: warning " > tempusdominus-bootstrap-4#5.1.2" has unmet peer dependency "tempusdominus-core#5.0.3".
remote: warning " > webpack-dev-server#3.9.0" has unmet peer dependency "webpack#^4.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 27.57s.
remote:
remote: -----> Build
remote:
remote: -----> Pruning devDependencies
remote: yarn install v1.19.1
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: info fsevents#1.2.9: The platform "linux" is incompatible with this module.
remote: info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies...
remote: warning " > tempusdominus-bootstrap-4#5.1.2" has unmet peer
dependency "moment-timezone#^0.5.11".
remote: warning " > tempusdominus-bootstrap-4#5.1.2" has unmet peer
dependency "tempusdominus-core#5.0.3".
remote: warning " > webpack-dev-server#3.9.0" has unmet peer
dependency "webpack#^4.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: warning Ignored scripts due to flag.
remote: Done in 5.14s.
remote:
remote: -----> Caching build
remote: - node_modules
remote:
remote: -----> Build succeeded!
remote: ! This app may not specify any way to start a node process
remote: https://devcenter.heroku.com/articles/nodejs-support#default-
web-process-type
remote:
remote: ! Unmet dependencies don't fail yarn install but may cause
runtime issues
remote: https://github.com/npm/npm/issues/7494
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.5.3
remote: -----> Installing dependencies using bundler 1.17.3
remote: Running: bundle install --without development:test --path
vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
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: Using rake 13.0.0
remote: Using concurrent-ruby 1.1.5
remote: Using i18n 1.7.0
remote: Using minitest 5.12.2
remote: Using thread_safe 0.3.6
remote: Using tzinfo 1.2.5
remote: Using zeitwerk 2.2.0
remote: Using activesupport 6.0.0
remote: Using builder 3.2.3
remote: Using erubi 1.9.0
remote: Using mini_portile2 2.4.0
remote: Using nokogiri 1.10.4
remote: Using rails-dom-testing 2.0.3
remote: Using crass 1.0.4
remote: Using loofah 2.3.0
remote: Using rails-html-sanitizer 1.3.0
remote: Using actionview 6.0.0
remote: Using rack 2.0.7
remote: Using rack-test 1.1.0
remote: Using actionpack 6.0.0
remote: Using nio4r 2.5.2
remote: Using websocket-extensions 0.1.4
remote: Using websocket-driver 0.7.1
remote: Using actioncable 6.0.0
remote: Using globalid 0.4.2
remote: Using activejob 6.0.0
remote: Using activemodel 6.0.0
remote: Using activerecord 6.0.0
remote: Using mimemagic 0.3.3
remote: Using marcel 0.3.3
remote: Using activestorage 6.0.0
remote: Using mini_mime 1.0.2
remote: Using mail 2.7.1
remote: Using actionmailbox 6.0.0
remote: Using actionmailer 6.0.0
remote: Using actiontext 6.0.0
remote: Using public_suffix 4.0.1
remote: Using addressable 2.7.0
remote: Using encryptor 3.0.0
remote: Using attr_encrypted 3.1.0
remote: Using execjs 2.7.0
remote: Using autoprefixer-rails 9.6.4
remote: Using aws-eventstream 1.0.3
remote: Using aws-partitions 1.222.0
remote: Using aws-sigv4 1.1.0
remote: Using jmespath 1.4.0
remote: Using aws-sdk-core 3.68.1
remote: Using aws-sdk-polly 1.26.0
remote: Using bcrypt 3.1.13
remote: Using msgpack 1.3.1
remote: Using bootsnap 1.4.5
remote: Using popper_js 1.14.5
remote: Using rb-fsevent 0.10.3
remote: Using ffi 1.11.1
remote: Using rb-inotify 0.10.0
remote: Using sass-listen 4.0.0
remote: Using sass 3.7.4
remote: Using bootstrap 4.0.0
remote: Using method_source 0.9.2
remote: Using thor 0.20.3
remote: Using railties 6.0.0
remote: Using jquery-rails 4.3.5
remote: Using momentjs-rails 2.20.1
remote: Using moment-timezone-rails 1.0.0
remote: Using bootstrap4-datetime-picker-rails 0.3.1
remote: Using bundler 1.17.3
remote: Using mini_magick 4.9.5
remote: Using ruby-vips 2.0.15
remote: Using image_processing 1.9.3
remote: Using carrierwave 2.0.2
remote: Using coffee-script-source 1.12.2
remote: Using coffee-script 2.4.1
remote: Using coffee-rails 5.0.0
remote: Using orm_adapter 0.5.0
remote: Using responders 3.0.0
remote: Using warden 1.2.8
remote: Using devise 4.7.1
remote: Using multi_json 1.13.1
remote: Using elasticsearch-api 7.3.0
remote: Using multipart-post 2.1.1
remote: Using faraday 0.17.0
remote: Using elasticsearch-transport 7.3.0
remote: Using elasticsearch 7.3.0
remote: Using hashie 3.6.0
remote: Using elasticsearch-model 7.0.0
remote: Using elasticsearch-rails 7.0.0
remote: Using excon 0.67.0
remote: Using formatador 0.2.5
remote: Using mime-types-data 3.2019.1009
remote: Using mime-types 3.3
remote: Using fog-core 2.1.2
remote: Using fog-json 1.2.0
remote: Using fog-xml 0.1.3
remote: Using ipaddress 0.8.3
remote: Using fog-aws 3.5.2
remote: Using jquery-ui-rails 6.0.1
remote: Using fullcalendar-rails 3.9.0.0
remote: Using hkdf 0.3.0
remote: Using jbuilder 2.9.1
remote: Using jwt 2.2.1
remote: Using kaminari-core 1.1.1
remote: Using kaminari-actionview 1.1.1
remote: Using kaminari-activerecord 1.1.1
remote: Using kaminari 1.1.1
remote: Using libv8 7.3.492.27.1 (x86_64-linux)
remote: Using mini_racer 0.2.6
remote: Using multi_xml 0.6.0
remote: Using oauth 0.4.7
remote: Using oauth2 1.4.2
remote: Using pg 1.1.4
remote: Using pr_geohash 1.0.0
remote: Using puma 4.2.1
remote: Using roxml 4.0.0
remote: Using quickbooks-ruby 1.0.0
remote: Using rack-proxy 0.6.5
remote: Using sprockets 4.0.0
remote: Using sprockets-rails 3.2.1
remote: Using rails 6.0.0
remote: Using rsolr 2.2.1
remote: Using ruby_http_client 3.3.0
remote: Using sassc 2.2.1
remote: Using tilt 2.0.10
remote: Using sassc-rails 2.1.2
remote: Using sass-rails 6.0.0
remote: Using sendgrid-ruby 6.0.0
remote: Using stripe 5.7.0
remote: Using sunspot 2.5.0
remote: Using sunspot_rails 2.5.0
remote: Using sunspot_solr 2.5.0
remote: Using twilio-ruby 5.27.1
remote: Using uglifier 4.2.0
remote: Using webpacker 4.0.7
remote: Using webpush 1.0.0
remote: Using wicked_pdf 1.4.0
remote: Using wkhtmltopdf-binary 0.12.4
remote: Bundle complete! 42 Gemfile dependencies, 135 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 (0.54s)
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: Detected manifest file, assuming assets were compiled locally
remote: -----> Detecting rails configuration
remote: -----> Detecting rake tasks
remote:
remote: ###### WARNING:
remote:
remote: Detecting rails configuration failed
remote: set HEROKU_DEBUG_RAILS_RUNNER=1 to debug
remote:
remote:
remote: ###### WARNING:
remote:
remote: We detected that some binary dependencies required to
remote: use all the preview features of Active Storage are not
remote: present on this system.
remote:
remote: For more information please see:
remote: https://devcenter.heroku.com/articles/active-storage-on-
heroku
remote:
remote:
remote:
remote: ###### WARNING:
remote:
remote: There is a more recent Ruby version available for you to use:
remote:
remote: 2.5.7
remote:
remote: The latest version will include security and bug fixes, we always recommend
remote: running the latest version of your minor release.
remote:
remote: Please upgrade your Ruby version.
remote:
remote: For all available Ruby versions see:
remote: https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote:
remote:
remote: ###### WARNING:
remote:
remote: No Procfile detected, using the default web server.
remote: We recommend explicitly declaring how to boot your server process via a Procfile.
remote: https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote:
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> console, rake, web
remote:
remote: -----> Compressing...
remote: Done: 218M
remote: -----> Launching...
remote: Released v573
remote: https://enigmatic-temple-38800.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.`
My best guess is that suggestion #4 is the problem Your webpack configuration is not creating a manifest. since the manifest shows as blank from the log but I am not sure how to troubleshoot this or fix it for that matter.
UPDATE
Please note that I am still using the Rails asset pipeline to serve css and images.
webpacker.yml (all default settings)
# Note: You must restart bin/webpack-dev-server for changes to take effect
default: &default
source_path: app/javascript
source_entry_path: packs
public_root_path: public
public_output_path: packs
cache_path: tmp/cache/webpacker
check_yarn_integrity: false
webpack_compile_output: false
# Additional paths webpack should lookup modules
# ['app/assets', 'engine/foo/app/assets']
resolved_paths: []
# Reload manifest.json on all requests so we reload latest compiled packs
cache_manifest: false
# Extract and emit a css file
extract_css: false
static_assets_extensions:
- .jpg
- .jpeg
- .png
- .gif
- .tiff
- .ico
- .svg
- .eot
- .otf
- .ttf
- .woff
- .woff2
extensions:
- .mjs
- .js
- .sass
- .scss
- .css
- .module.sass
- .module.scss
- .module.css
- .png
- .svg
- .gif
- .jpeg
- .jpg
development:
<<: *default
compile: true
# Verifies that correct packages and versions are installed by inspecting package.json, yarn.lock, and node_modules
check_yarn_integrity: true
# Reference: https://webpack.js.org/configuration/dev-server/
dev_server:
https: false
host: localhost
port: 3035
public: localhost:3035
hmr: false
# Inline should be set to true if using HMR
inline: true
overlay: true
compress: true
disable_host_check: true
use_local_ip: false
quiet: false
headers:
'Access-Control-Allow-Origin': '*'
watch_options:
ignored: '**/node_modules/**'
test:
<<: *default
compile: true
# Compile test packs to a separate directory
public_output_path: packs-test
production:
<<: *default
# Production depends on precompilation of packs prior to booting for
performance.
compile: false
# Extract and emit a css file
extract_css: true
# Cache manifest.json for performance
cache_manifest: true

The problem is this log message Detected manifest file, assuming assets were compiled locally
The problem is probably that you ran assets:precompile locally and then committed public/assets directory.
Run git rm -rf public/assets add the directory to .gitignore commit and push to heroku. Should work now.

Your issue looks similar to issue #2071. In your webpacker.yml, under production add
extract_css: true

Related

Pushing the app to production on Heroku is failing

I am trying to push the code to heroku but it is failing. The created app works fine on my computer but is failing when deployed to Heroku. I am using Rails version 6.1.6.1 in this deployment. Earlier, I created the same app using Rails version 7 and that got deployed flawlessly. I am new to this. I can see few warnings when pushing the code to Heroku. Please help what am I doing wrong.
D:\develop\rubyproject\alphablog>git push heroku main
Enumerating objects: 9, done.
Counting objects: 100% (9/9), done.
Delta compression using up to 8 threads
Compressing objects: 100% (6/6), done.
Writing objects: 100% (6/6), 607 bytes | 607.00 KiB/s, done.
Total 6 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/ruby
remote: -----> Ruby app detected
remote: -----> Installing bundler 2.3.10
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-3.1.2
remote:
remote: ###### WARNING:
remote:
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:
remote: https://devcenter.heroku.com/articles/bundler-windows-gemfile
remote:
remote: -----> Installing dependencies using bundler 2.3.10
remote: Running: BUNDLE_WITHOUT='development:test' BUNDLE_PATH=vendor/bundle BUNDLE_BIN=vendor/bundle/bin bundle install -j4
remote: Fetching gem metadata from https://rubygems.org/...........
remote: Resolving dependencies.....
remote: Using rake 13.0.6
remote: Using concurrent-ruby 1.1.10
remote: Using minitest 5.16.2
remote: Using zeitwerk 2.6.0
remote: Using builder 3.2.4
remote: Using erubi 1.11.0
remote: Using racc 1.6.0
remote: Using crass 1.0.6
remote: Using rack 2.2.4
remote: Using nio4r 2.5.8
remote: Using websocket-extensions 0.1.5
remote: Using marcel 1.0.2
remote: Using mini_mime 1.1.2
remote: Using msgpack 1.5.4
remote: Using bundler 2.3.10
remote: Using ffi 1.15.5
remote: Using method_source 1.0.0
remote: Using pg 1.4.2
remote: Using thor 1.2.1
remote: Using tilt 2.0.11
remote: Using semantic_range 3.0.0
remote: Using turbolinks-source 5.2.0
remote: Using i18n 1.12.0
remote: Using tzinfo 2.0.5
remote: Using activesupport 6.1.6.1
remote: Using nokogiri 1.13.8 (x86_64-linux)
remote: Using rack-test 2.0.2
remote: Using websocket-driver 0.7.5
remote: Using mail 2.7.1
remote: Using bootsnap 1.13.0
remote: Using puma 5.6.4
remote: Using rack-proxy 0.7.2
remote: Using sprockets 4.1.1
remote: Using sassc 2.4.0
remote: Using turbolinks 5.2.1
remote: Using rails-dom-testing 2.0.3
remote: Using loofah 2.18.0
remote: Using globalid 1.0.0
remote: Using activemodel 6.1.6.1
remote: Using rails-html-sanitizer 1.4.3
remote: Using activejob 6.1.6.1
remote: Using activerecord 6.1.6.1
remote: Using actionview 6.1.6.1
remote: Using actionpack 6.1.6.1
remote: Using jbuilder 2.11.5
remote: Using actioncable 6.1.6.1
remote: Using activestorage 6.1.6.1
remote: Using actionmailer 6.1.6.1
remote: Using railties 6.1.6.1
remote: Using sprockets-rails 3.4.2
remote: Using actiontext 6.1.6.1
remote: Using actionmailbox 6.1.6.1
remote: Using webpacker 5.4.3
remote: Using rails 6.1.6.1
remote: Using sassc-rails 2.1.2
remote: Using sass-rails 6.0.0
remote: Bundle complete! 16 Gemfile dependencies, 56 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 (2.83s)
remote: Cleaning up the bundler cache.
remote: -----> Installing node-v16.13.1-linux-x64
remote: -----> Installing yarn-v1.22.17
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: You don't have net-smtp installed in your application. Please add it to your Gemfile and run bundle install
remote: yarn install v1.22.17
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: [3/4] Linking dependencies...
remote: [4/4] Building fresh packages...
remote: Done in 15.60s.
remote: Compiling...
remote: Compiled all packs in /tmp/build_a9f44d06/public/packs
remote: Hash: 964bd55ba6668af1f1c1
remote: Version: webpack 4.46.0
remote: Time: 3673ms
remote: Built at: 08/09/2022 6:46:50 AM
remote: Asset Size Chunks Chunk Names
remote: js/application-4cb2b08e3c41888f7737.js 68.2 KiB 0 [emitted] [immutable] application
remote: js/application-4cb2b08e3c41888f7737.js.br 15.2 KiB [emitted]
remote: js/application-4cb2b08e3c41888f7737.js.gz 17.5 KiB [emitted]
remote: js/application-4cb2b08e3c41888f7737.js.map 204 KiB 0 [emitted] [dev] application
remote: js/application-4cb2b08e3c41888f7737.js.map.br 43.4 KiB [emitted]
remote: js/application-4cb2b08e3c41888f7737.js.map.gz 50.2 KiB [emitted]
remote: manifest.json 364 bytes [emitted]
remote: manifest.json.br 129 bytes [emitted]
remote: manifest.json.gz 142 bytes [emitted]
remote: Entrypoint application = js/application-4cb2b08e3c41888f7737.js js/application-4cb2b08e3c41888f7737.js.map
remote: [3] ./app/javascript/packs/application.js 480 bytes {0} [built]
remote: [4] ./app/javascript/channels/index.js 205 bytes {0} [built]
remote: [5] ./app/javascript/channels sync _channel\.js$ 160 bytes {0} [built]
remote: + 3 hidden modules
remote:
remote: Asset precompilation completed (23.49s)
remote: Cleaning assets
remote: Running: rake assets:clean
remote: You don't have net-smtp installed in your application. Please add it to your Gemfile and run bundle install
remote: -----> Detecting rails configuration
remote:
remote: ###### WARNING:
remote:
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:
remote: https://devcenter.heroku.com/articles/bundler-windows-gemfile
remote:
remote: ###### WARNING:
remote:
remote: Detecting rails configuration failed
remote: set HEROKU_DEBUG_RAILS_RUNNER=1 to debug
remote:
remote: ###### WARNING:
remote:
remote: No Procfile detected, using the default web server.
remote: We recommend explicitly declaring how to boot your server process via a Procfile.
remote: https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> console, rake, web
remote:
remote: -----> Compressing...
remote: Done: 91.6M
remote: -----> Launching...
remote: Released v7
remote: https://alphablogonr6.herokuapp.com/ deployed to Heroku
remote:
remote: This app is using the Heroku-20 stack, however a newer stack is available.
remote: To upgrade to Heroku-22, see:
remote: https://devcenter.heroku.com/articles/upgrading-to-the-latest-stack
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/alphablogonr6.git
aaa1b45..55e9f84 main -> main
Your code is deployed just fine. But something about your application is throwing an error when you try to load the homepage.
Heroku is really friendly for checking the logs.
You can check the logs in your dashboard. The URL will be like this:
https://dashboard.heroku.com/apps/(yourappname)/logs
Or, install the Heroku Command Line Interface
then from the console, within your project file, do this:
heroku logs -t
This will print out the server logs on your local console.
I'd bet a dollar that you actually forgot to perform a migration:
heroku run rails db:migrate
This is usually the thing I forget to do.

Rails Deployment to Heroku: NoMethodError: undefined method `+' for nil:NilClass

I'm new to Rails but have been working on an app the last few weeks that has been working great in development and in production when I deploy to Heroku.
Today I made some minor changes to my application.css file and now I am getting a "Precompiling assets failed" error when I try to deploy to Heroku. With a NoMethodError: undefined method `+' for nil:NilClass. Running ruby 2.6.5, Rails 6.0.3.1, PG 1.2.3
I've attached the logs below which may or may not be helpful. I obviously don't have the knowledge of how to debug this properly so advice on what might be causing the error is great but failing that, how should I be trying to replicate this error locally and figuring it out?
I've already tried, with no success:
Changing the application.css file to .scss
Adding config.assets.initialize_on_precompile = false to the application.rb file
Reverting to my last successful commit
Thank you!
Enumerating objects: 78, done.
Counting objects: 100% (78/78), done.
Delta compression using up to 8 threads
Compressing objects: 100% (61/61), done.
Writing objects: 100% (61/61), 5.07 KiB | 519.00 KiB/s, done.
Total 61 (delta 46), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Installing bundler 1.17.3
remote: -----> Removing BUNDLED WITH version in the Gemfile.lock
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.6.5
remote:
remote: ###### WARNING:
remote:
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.17.3
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4
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: Fetching gem metadata from https://rubygems.org/.............
remote: Fetching gem metadata from https://rubygems.org/.
remote: Resolving dependencies.....
remote: Using rake 13.0.1
remote: Using concurrent-ruby 1.1.6
remote: Using minitest 5.14.1
remote: Using thread_safe 0.3.6
remote: Using zeitwerk 2.3.0
remote: Using builder 3.2.4
remote: Using erubi 1.9.0
remote: Using mini_portile2 2.4.0
remote: Using crass 1.0.6
remote: Using rack 2.2.2
remote: Using nio4r 2.5.2
remote: Fetching websocket-extensions 0.1.5
remote: Using mimemagic 0.3.5
remote: Using mini_mime 1.0.2
remote: Using formtastic_i18n 0.6.0
remote: Using method_source 1.0.0
remote: Using thor 1.0.1
remote: Using kaminari-core 1.2.1
remote: Fetching ffi 1.13.0
remote: Using tilt 2.0.10
remote: Using bcrypt 3.1.13
remote: Using msgpack 1.3.3
remote: Using bundler 1.17.3
remote: Using orm_adapter 0.5.0
remote: Using hashids 1.0.5
remote: Using pg 1.2.3
remote: Using turbolinks-source 5.2.0
remote: Fetching i18n 1.8.3
remote: Installing websocket-extensions 0.1.5
remote: Installing i18n 1.8.3
remote: Using tzinfo 1.2.7
remote: Using nokogiri 1.10.9
remote: Using puma 4.3.5
remote: Using rack-test 1.1.0
remote: Fetching sprockets 4.0.1
remote: Installing sprockets 4.0.1
remote: Installing ffi 1.13.0 with native extensions
remote: Using warden 1.2.8
remote: Using rack-proxy 0.6.5
remote: Using marcel 0.3.3
remote: Using mail 2.7.1
remote: Using bootsnap 1.4.6
remote: Using turbolinks 5.2.1
remote: Using loofah 2.5.0
remote: Using websocket-driver 0.7.2
remote: Using activesupport 6.0.3.1
remote: Using rails-dom-testing 2.0.3
remote: Using rails-html-sanitizer 1.3.0
remote: Using globalid 0.4.2
remote: Using activemodel 6.0.3.1
remote: Using arbre 1.2.1
remote: Using jbuilder 2.10.0
remote: Using actionview 6.0.3.1
remote: Using activejob 6.0.3.1
remote: Using activerecord 6.0.3.1
remote: Using actionpack 6.0.3.1
remote: Using kaminari-actionview 1.2.1
remote: Using kaminari-activerecord 1.2.1
remote: Using polyamorous 2.3.2
remote: Using hashid-rails 1.4.0
remote: Using actioncable 6.0.3.1
remote: Using activestorage 6.0.3.1
remote: Using actionmailer 6.0.3.1
remote: Using formtastic 3.1.5
remote: Using has_scope 0.7.2
remote: Using railties 6.0.3.1
remote: Using kaminari 1.2.1
remote: Using ransack 2.3.2
remote: Using actionmailbox 6.0.3.1
remote: Using actiontext 6.0.3.1
remote: Using responders 3.0.1
remote: Using jquery-rails 4.4.0
remote: Using webpacker 4.2.2
remote: Using inherited_resources 1.11.0
remote: Using devise 4.7.1
remote: Using sprockets-rails 3.2.1
remote: Using rails 6.0.3.1
remote: Fetching sassc 2.4.0
remote: Installing sassc 2.4.0 with native extensions
remote: Using sassc-rails 2.1.2
remote: Using activeadmin 2.7.0
remote: Using sass-rails 6.0.0
remote: Bundle complete! 18 Gemfile dependencies, 77 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: Removing i18n (1.8.2)
remote: Removing sprockets (4.0.0)
remote: Removing websocket-extensions (0.1.4)
remote: Removing ffi (1.12.2)
remote: Removing sassc (2.3.0)
remote: Bundle completed (186.51s)
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.13: The platform "linux" is incompatible with this module.
remote: info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies...
remote: warning " > webpack-dev-server#3.11.0" 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 23.47s.
remote: yarn install v1.16.0
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: info fsevents#1.2.13: The platform "linux" is incompatible with this module.
remote: info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
remote: [3/4] Linking dependencies...
remote: warning " > webpack-dev-server#3.11.0" 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 5.05s.
remote: I, [2020-06-05T05:23:48.123557 #791] INFO -- : Writing /tmp/build_89a8346fedd1ed19bb5329c741888493/public/assets/active_admin-312e30985f3b0561c5db85eaba9b50b1d2c6fcbcff0e0cd5ae0862f13ef86223
796473.css
remote: I, [2020-06-05T05:23:48.123844 #791] INFO -- : Writing /tmp/build_89a8346fedd1ed19bb5329c741888493/public/assets/active_admin-312e30985f3b0561c5db85eaba9b50b1d2c6fcbcff0e0cd5ae0862f13ef86223
796473.css.gz
remote: I, [2020-06-05T05:23:48.124090 #791] INFO -- : Writing /tmp/build_89a8346fedd1ed19bb5329c741888493/public/assets/active_admin/print-312e30cf99cbf27fb92065a9eacd28e6fad48fa72cadaf6e0918790e8d
35b11d8f99f6.css
remote: I, [2020-06-05T05:23:48.124270 #791] INFO -- : Writing /tmp/build_89a8346fedd1ed19bb5329c741888493/public/assets/active_admin/print-312e30cf99cbf27fb92065a9eacd28e6fad48fa72cadaf6e0918790e8d
35b11d8f99f6.css.gz
remote: I, [2020-06-05T05:23:48.124504 #791] INFO -- : Writing /tmp/build_89a8346fedd1ed19bb5329c741888493/public/assets/manifest-312e3075a11da44c802486bc6f65640aa48a730f0f684c5c07a42ba3cd1735eb3fb0
70.js
remote: I, [2020-06-05T05:23:48.124686 #791] INFO -- : Writing /tmp/build_89a8346fedd1ed19bb5329c741888493/public/assets/manifest-312e3075a11da44c802486bc6f65640aa48a730f0f684c5c07a42ba3cd1735eb3fb0
70.js.gz
remote: rake aborted!
remote: NoMethodError: undefined method `+' for nil:NilClass
remote: /tmp/build_89a8346fedd1ed19bb5329c741888493/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.1/lib/sprockets/asset.rb:138:in `etag'
remote: /tmp/build_89a8346fedd1ed19bb5329c741888493/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.1/lib/sprockets/asset.rb:67:in `block in digest_path'
remote: /tmp/build_89a8346fedd1ed19bb5329c741888493/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.1/lib/sprockets/asset.rb:67:in `sub'
remote: /tmp/build_89a8346fedd1ed19bb5329c741888493/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.1/lib/sprockets/asset.rb:67:in `digest_path'
remote: /tmp/build_89a8346fedd1ed19bb5329c741888493/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.1/lib/sprockets/manifest.rb:175:in `block in compile'
remote: /tmp/build_89a8346fedd1ed19bb5329c741888493/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.1/lib/sprockets/manifest.rb:173:in `each'
remote: /tmp/build_89a8346fedd1ed19bb5329c741888493/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.1/lib/sprockets/manifest.rb:173:in `compile'
remote: /tmp/build_89a8346fedd1ed19bb5329c741888493/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
remote: /tmp/build_89a8346fedd1ed19bb5329c741888493/vendor/bundle/ruby/2.6.0/gems/sprockets-4.0.1/lib/rake/sprocketstask.rb:148:in `with_logger'
remote: /tmp/build_89a8346fedd1ed19bb5329c741888493/vendor/bundle/ruby/2.6.0/gems/sprockets-rails-3.2.1/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
remote: /tmp/build_89a8346fedd1ed19bb5329c741888493/vendor/bundle/ruby/2.6.0/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
remote: Tasks: TOP => assets:precompile
remote: (See full trace by running task with --trace)
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 ...
remote:
Here is possible solution: not tried yet, but you should take a look.
https://github.com/rails/sprockets/issues/683
Basically in config/initializers/assets.rb, you need to update the Rails.application.config.assets.version value as well. I dont know how this affects deployment (how to know when to change this value? do we rely on deployment to fail first, then change this?)

What do I do? Heroku blocked my push even after updating Sprockets

Does anyone have any inkling as to what I did wrong or what I should do? I tried pushing after updating Sprockets in my gemfile, but it didn't seem to do anything. Do I need to update sprockets-rails as well too? Even after updating the gemfile the console error didn't seem to change at all. This is the error I get, even after updating sprockets to the recommended version, I even tried to delete and re-bundle the gems.
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.4.1
remote: -----> Installing dependencies using bundler 1.15.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Fetching gem metadata from https://rails-assets.org/..
remote: Fetching gem metadata from https://rubygems.org/.........
remote: Fetching version metadata from https://rails-assets.org/..
remote: Fetching version metadata from https://rubygems.org/..
remote: Fetching dependency metadata from https://rails-assets.org/..
remote: Fetching dependency metadata from https://rubygems.org/.
remote: Fetching gem metadata from https://rails-assets.org/..
remote: Fetching version metadata from https://rails-assets.org/.
remote: Using rake 12.3.1
remote: Using concurrent-ruby 1.0.5
remote: Using minitest 5.11.3
remote: Using thread_safe 0.3.6
remote: Using builder 3.2.3
remote: Using erubi 1.7.1
remote: Using mini_portile2 2.3.0
remote: Using crass 1.0.4
remote: Using rack 2.0.5
remote: Using nio4r 2.3.1
remote: Using websocket-extensions 0.1.3
remote: Using mini_mime 1.0.0
remote: Using arel 9.0.0
remote: Using mimemagic 0.3.2
remote: Using execjs 2.7.0
remote: Using msgpack 1.2.4
remote: Using rb-fsevent 0.10.3
remote: Using ffi 1.9.25
remote: Using bundler 1.15.2
remote: Using coffee-script-source 1.12.2
remote: Using method_source 0.9.0
remote: Using thor 0.20.0
remote: Using multi_json 1.13.1
remote: Using pg 0.20.0
remote: Using puma 3.11.4
remote: Using rails-assets-particles.js 2.0.0
remote: Using tilt 2.0.8
remote: Using turbolinks-source 5.1.0
remote: Using i18n 1.0.1
remote: Using tzinfo 1.2.5
remote: Using nokogiri 1.8.2
remote: Using rack-test 1.0.0
remote: Using sprockets 3.7.1
remote: Using websocket-driver 0.7.0
remote: Using mail 2.7.0
remote: Using marcel 0.3.2
remote: Using autoprefixer-rails 8.6.2
remote: Using uglifier 4.1.11
remote: Using bootsnap 1.3.0
remote: Using rb-inotify 0.9.10
remote: Using coffee-script 2.4.1
remote: Using turbolinks 5.1.1
remote: Using activesupport 5.2.0
remote: Using loofah 2.2.2
remote: Using rails-dom-testing 2.0.3
remote: Using globalid 0.4.1
remote: Using activemodel 5.2.0
remote: Using jbuilder 2.7.0
remote: Using sass-listen 4.0.0
remote: Using activerecord 5.2.0
remote: Using rails-html-sanitizer 1.0.4
remote: Using sass 3.5.6
remote: Using actionview 5.2.0
remote: Using activejob 5.2.0
remote: Using actionpack 5.2.0
remote: Using bootstrap-sass 3.3.7
remote: Using actioncable 5.2.0
remote: Using actionmailer 5.2.0
remote: Using activestorage 5.2.0
remote: Using railties 5.2.0
remote: Using sprockets-rails 3.2.1
remote: Using coffee-rails 4.2.2
remote: Using jquery-rails 4.3.1
remote: Using jquery-ui-rails 6.0.1
remote: Using rails 5.2.0
remote: Using rails-ujs 0.1.0
remote: Using sass-rails 5.0.7
remote: Bundle complete! 25 Gemfile dependencies, 67 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 (5.93s)
remote: Cleaning up the bundler cache.
remote: Warning: the running version of Bundler (1.15.2) is older than the version that created the lockfile (1.16.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: The latest bundler is 1.16.2, but you are currently running 1.15.2.
remote: To update, run `gem install bundler`
remote: -----> Installing node-v8.10.0-linux-x64
remote: -----> Detecting rake tasks
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: Yarn executable was not detected in the system.
remote: Download Yarn at https://yarnpkg.com/en/docs/install
remote: I, [2018-07-01T05:03:06.512433 #474] INFO -- : Writing /tmp/build_8a91e4f1227e923975e3a79b263ebd6a/public/assets/homepage-6506ef98672650880a9829198532c3ca352e86c99fe090e6ab680341ebabb7a0.css
remote: I, [2018-07-01T05:03:06.512936 #474] INFO -- : Writing /tmp/build_8a91e4f1227e923975e3a79b263ebd6a/public/assets/homepage-6506ef98672650880a9829198532c3ca352e86c99fe090e6ab680341ebabb7a0.css.gz
remote: I, [2018-07-01T05:03:14.402376 #474] INFO -- : Writing /tmp/build_8a91e4f1227e923975e3a79b263ebd6a/public/assets/application-257151e69df1b673bb56ffceccaab1209f0d77eb0251792415b789094e1c1214.css
remote: I, [2018-07-01T05:03:14.403083 #474] INFO -- : Writing /tmp/build_8a91e4f1227e923975e3a79b263ebd6a/public/assets/application-257151e69df1b673bb56ffceccaab1209f0d77eb0251792415b789094e1c1214.css.gz
remote: Asset precompilation completed (10.25s)
remote: Cleaning assets
remote: Running: rake assets:clean
remote: -----> Detecting rails configuration
remote: !
remote: ! A security vulnerability has been detected in your application.
remote: ! To protect your application you must take action. Your application
remote: ! is currently exposing its credentials via an easy to exploit directory
remote: ! traversal.
remote: !
remote: ! To protect your application you must either upgrade to Sprockets version "3.7.2"
remote: ! or disable dynamic compilation at runtime by setting:
remote: !
remote: ! ```
remote: ! config.assets.compile = false # Disables security vulnerability
remote: ! ```
remote: !
remote: ! To read more about this security vulnerability please refer to this blog post:
remote: ! https://blog.heroku.com/rails-asset-pipeline-vulnerability
remote: !
remote: ! Push rejected, failed to compile Ruby app.
remote:
remote: ! Push failed
remote: Verifying deploy...

Rails 5 client side validations not working on Heroku

In development my client side validations have been working great, however when I push it to Heroku they aren't running. It seems the javascript isn't running correctly.
The model still validates and rejects bad input.
I've been searching Google trying any solution I come across but to no avail. I even precompiled my assets for the production environment and pushed them to see if that would work but nope.
This is my first time using Rails in quite a while so I'm not entire sure what parts of my code you'd need to see to diagnose the issue but any help would be appreciated.
EDIT: adding model and more info
I'm using the client_side_validations gem
Currently I'm just checking the presence of the input then using a regex to ensure it's a URL.
class Url < ApplicationRecord
after_create :generate_slug
validates :given_url, presence: true
validates_format_of :given_url, :with => /(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([\-\.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?\z/
# Convert the ID to base36 to be used as the path
def generate_slug
self.slug = self.id.to_s(36)
self.save
end
# construct the new URL
def display_slug
ENV['BASE_URL'] + self.slug
end
end
Here is the form that's in my view
<%= form_for #url, validate: true, remote: true do |f| %>
<div class ="input-group">
<label hidden></label>
<%= f.text_field :given_url, validate: {presence: true}, :class => "form-control", :placeholder => "Give me a link..." %>
<span class="input-group-btn">
<%= f.submit 'Go!', :class => "btn btn-primary btn-lg" %>
</span>
</div> <!-- input group -->
<% end %>
and the deployment log
Total 0 (delta 0), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Node.js app detected
remote:
remote: -----> Creating runtime environment
remote:
remote: NPM_CONFIG_LOGLEVEL=error
remote: NPM_CONFIG_PRODUCTION=true
remote: NODE_VERBOSE=false
remote: NODE_ENV=production
remote: NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote: engines.yarn (package.json): unspecified (use default)
remote:
remote: Resolving node version 6.x via semver.io...
remote: Downloading and installing node 6.11.0...
remote: Using default npm version: 3.10.10
remote: Resolving yarn version (latest) via semver.io...
remote: Downloading and installing yarn (0.24.5)...
remote: Installed yarn 0.24.5
remote:
remote: -----> Restoring cache
remote: Loading 2 from cacheDirectories (default):
remote: - node_modules (not cached - skipping)
remote: - bower_components (not cached - skipping)
remote:
remote: -----> Building dependencies
remote: Installing node modules (yarn.lock)
remote: yarn install v0.24.5
remote: [1/4] Resolving packages...
remote: [2/4] Fetching packages...
remote: [3/4] Linking dependencies...
remote: [4/4] Building fresh packages...
remote: Done in 0.07s.
remote:
remote: -----> Caching build
remote: Clearing previous node cache
remote: Saving 2 cacheDirectories (default):
remote: - node_modules (nothing to cache)
remote: - bower_components (nothing to cache)
remote:
remote: -----> Build succeeded!
remote: ! This app may not specify any way to start a node process
remote: https://devcenter.heroku.com/articles/nodejs-support#default-web-process-type
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.3.4
remote: -----> Installing dependencies using bundler 1.15.1
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
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: Using rake 12.0.0
remote: Using concurrent-ruby 1.0.5
remote: Using i18n 0.8.4
remote: Using minitest 5.10.2
remote: Using thread_safe 0.3.6
remote: Using builder 3.2.3
remote: Using erubi 1.6.0
remote: Using mini_portile2 2.2.0
remote: Using rack 2.0.3
remote: Using nio4r 2.1.0
remote: Using websocket-extensions 0.1.2
remote: Using mime-types-data 3.2016.0521
remote: Using arel 8.0.0
remote: Using method_source 0.8.2
remote: Using thor 0.19.4
remote: Using bundler 1.15.1
remote: Using pg 0.21.0
remote: Using puma 3.9.1
remote: Using sass 3.4.24
remote: Using tilt 2.0.7
remote: Using execjs 2.7.0
remote: Using coffee-script-source 1.12.2
remote: Using turbolinks-source 5.0.3
remote: Using multi_json 1.12.1
remote: Using regexp_parser 0.4.3
remote: Using nokogiri 1.8.0
remote: Using websocket-driver 0.6.5
remote: Using mime-types 3.1
remote: Using tzinfo 1.2.3
remote: Using rack-test 0.6.3
remote: Using sprockets 3.7.1
remote: Using figaro 1.1.1
remote: Using uglifier 3.2.0
remote: Using autoprefixer-rails 7.1.1.2
remote: Using turbolinks 5.0.1
remote: Using coffee-script 2.4.1
remote: Using mail 2.6.6
remote: Using js_regex 1.2.3
remote: Using activesupport 5.1.1
remote: Using loofah 2.0.3
remote: Using rails-dom-testing 2.0.3
remote: Using globalid 0.4.0
remote: Using activemodel 5.1.1
remote: Using jbuilder 2.7.0
remote: Using rails-html-sanitizer 1.0.3
remote: Using bootstrap 4.0.0.alpha6
remote: Using activejob 5.1.1
remote: Using activerecord 5.1.1
remote: Using actionview 5.1.1
remote: Using actionpack 5.1.1
remote: Using actioncable 5.1.1
remote: Using actionmailer 5.1.1
remote: Using railties 5.1.1
remote: Using sprockets-rails 3.2.0
remote: Using jquery-rails 4.3.1
remote: Using coffee-rails 4.2.2
remote: Using rails 5.1.1
remote: Using sass-rails 5.0.6
remote: Using client_side_validations 9.3.3
remote: Bundle complete! 20 Gemfile dependencies, 59 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 (2.69s)
remote: Cleaning up the bundler cache.
remote: Detected manifest file, assuming assets were compiled locally
remote:
remote: ###### WARNING:
remote: You have not declared a Ruby version in your Gemfile.
remote: To set your Ruby version add this line to your Gemfile:
remote: ruby '2.3.4'
remote: # See https://devcenter.heroku.com/articles/ruby-versions for more information.
remote:
remote: ###### WARNING:
remote: No Procfile detected, using the default web server.
remote: We recommend explicitly declaring how to boot your server process via a Procfile.
remote: https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> console, rake, web, worker
remote:
remote: -----> Compressing...
remote: Done: 40M
remote: -----> Launching...
remote: Released v25
remote: https://fathomless-plateau-97011.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
For your app/assets/javascripts/application.js make sure you have
//= require rails.validations
the site sample shows no need to use remote: true, for your form for
my understanding the gem will handle ajax request so you don't need to put remote: true again for ajax manually

Heroku Status=500 Without Further Error Explanation

I just pushed an update (which works perfectly on localhost) to Heroku and I'm getting a status=500 error in my logs, a We're sorry, but something went wrong. page for my index page, and no further information.
Here is the information from git push heroku master:
Counting objects: 3733, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3205/3205), done.
Writing objects: 100% (3733/3733), 7.43 MiB | 1.01 MiB/s, done.
Total 3733 (delta 943), reused 2943 (delta 463)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.4
remote: ###### WARNING:
remote: You have the `.bundle/config` file checked into your repository
remote: It contains local state like the location of the installed bundle
remote: as well as configured git local gems, and other settings that should
remote: not be shared between multiple checkouts of a single repo. Please
remote: remove the `.bundle/` folder from your repo and add it to your `.gitignore` file.
remote: https://devcenter.heroku.com/articles/bundler-configuration
remote:
remote: -----> Installing dependencies using bundler 1.11.2
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Your Gemfile lists the gem pg (>= 0) more than once.
remote: You should probably keep only one of them.
remote: While it's not a problem now, it could cause errors if you change the version of just one of them later.
remote: Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
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: Using rake 11.1.2
remote: Using json 1.8.3
remote: Using i18n 0.7.0
remote: Using minitest 5.8.4
remote: Using thread_safe 0.3.5
remote: Using builder 3.2.2
remote: Using erubis 2.7.0
remote: Using mini_portile2 2.0.0
remote: Using rack 1.6.4
remote: Using mime-types-data 3.2016.0221
remote: Using arel 6.0.3
remote: Using execjs 2.6.0
remote: Using bcrypt 3.1.11
remote: Using sass 3.4.22
remote: Using coffee-script-source 1.10.0
remote: Using thor 0.19.1
remote: Using concurrent-ruby 1.0.1
remote: Using google-analytics-rails 1.1.0
remote: Using pg 0.18.4
remote: Using bundler 1.11.2
remote: Using tilt 2.0.2
remote: Using tzinfo 1.2.2
remote: Using nokogiri 1.6.7.2
remote: Using rack-test 0.6.3
remote: Using mime-types 3.0
remote: Using autoprefixer-rails 6.3.6
remote: Using uglifier 3.0.0
remote: Using figaro 1.0.0
remote: Using coffee-script 2.4.1
remote: Using sprockets 3.6.0
remote: Using activesupport 4.2.6
remote: Using loofah 2.0.3
remote: Using mail 2.6.4
remote: Using bootstrap-sass 3.3.6
remote: Using rails-deprecated_sanitizer 1.0.3
remote: Using globalid 0.3.6
remote: Using activemodel 4.2.6
remote: Using rails-html-sanitizer 1.0.3
remote: Using rails-dom-testing 1.0.7
remote: Using activejob 4.2.6
remote: Using activerecord 4.2.6
remote: Using actionview 4.2.6
remote: Using actionpack 4.2.6
remote: Using actionmailer 4.2.6
remote: Using railties 4.2.6
remote: Using sprockets-rails 3.0.4
remote: Using simple_form 3.2.1
remote: Using mail_form 1.5.1
remote: Using coffee-rails 4.1.1
remote: Installing orm_adapter 0.5.0
remote: Installing warden 1.2.6
remote: Installing responders 2.2.0
remote: Using jquery-rails 4.1.1
remote: Using rails 4.2.6
remote: Using sass-rails 5.0.4
remote: Using turbolinks 2.5.3
remote: Installing jquery-turbolinks 2.1.0
remote: Installing devise 4.2.0
remote: Bundle complete! 20 Gemfile dependencies, 58 gems now installed.
remote: Gems in the groups development, test and production were not installed.
remote: Bundled gems are installed into ./vendor/bundle.
remote: Bundle completed (4.42s)
remote: Cleaning up the bundler cache.
remote: Your Gemfile lists the gem pg (>= 0) more than once.
remote: You should probably keep only one of them.
remote: While it's not a problem now, it could cause errors if you change the version of just one of them later.
remote: Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
remote: Detected manifest file, assuming assets were compiled locally
remote:
remote: ###### WARNING:
remote: You have not declared a Ruby version in your Gemfile.
remote: To set your Ruby version add this line to your Gemfile:
remote: ruby '2.2.4'
remote: # See https://devcenter.heroku.com/articles/ruby-versions for more information.
remote:
remote: ###### WARNING:
remote: You have the `.bundle/config` file checked into your repository
remote: It contains local state like the location of the installed bundle
remote: as well as configured git local gems, and other settings that should
remote: not be shared between multiple checkouts of a single repo. Please
remote: remove the `.bundle/` folder from your repo and add it to your `.gitignore` file.
remote: https://devcenter.heroku.com/articles/bundler-configuration
remote:
remote: ###### WARNING:
remote: No Procfile detected, using the default web server.
remote: We recommend explicitly declaring how to boot your server process via a Procfile.
remote: https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for buildpack -> console, rake, web, worker
remote:
remote: -----> Compressing...
remote: Done: 182.8M
remote: -----> Launching...
remote: Released v20
remote: https://frozen-lowlands-30190.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/frozen-lowlands-30190.git
5f16820..3583a96 master -> master
And here's the status=500 line I get, which doesn't have further explanation:
2016-09-07T21:43:17.513968+00:00 heroku[router]: at=info method=GET path="/" host=www.geneticgolf.com request_id=e52af315-b9c6-4029-af51-69deada5b2f3 fwd="70.181.88.50" dyno=web.1 connect=1ms service=33ms status=500 bytes=1754
I have run heroku run rake db:migrate and heroku restart, but to no avail. I also have the rails_12factor gem installed in my production group gemfile already.
Can anyone point out where the error might be or how to fix it? The site is live so an erroring index page is bad...
NEW INFORMATION
The staging link for my site is apparently not exhibiting this problem, only the domain name that points to the staging link.
I messaged Heroku support and they said that I should remove .bundle/config from my Git files because it was preventing my production gems from being installed, which prohibited rails_12factor from giving me information about the error. Once this change was made the heroku logs actually began yielding useful information and I was able to debug.

Resources