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.
Related
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?)
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
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.
I don't see any error message.
but when I run heroku open , the browser shows "We're sorry, but something went wrong."
The app runs fine offline.
the code
https://github.com/codelearner777/blog
could somebody help me?
budi#Lenovo:~/blog$ heroku create
Creating rocky-badlands-5818... done, stack is cedar-14
https://rocky-badlands-5818.herokuapp.com/ | https://git.heroku.com/rocky-badlands-5818.git
Git remote heroku added
budi#Lenovo:~/blog$ git push heroku master
Counting objects: 139, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (98/98), done.
Writing objects: 100% (139/139), 26.23 KiB | 0 bytes/s, done.
Total 139 (delta 31), reused 139 (delta 31)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.3
remote: -----> Installing dependencies using bundler 1.9.7
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 10.4.2
remote: Installing minitest 5.8.2
remote: Installing i18n 0.7.0
remote: Installing thread_safe 0.3.5
remote: Installing builder 3.2.2
remote: Installing mini_portile 0.6.2
remote: Installing erubis 2.7.0
remote: Installing rack 1.6.4
remote: Installing mime-types 2.6.2
remote: Installing json 1.8.3
remote: Installing arel 6.0.3
remote: Installing coffee-script-source 1.9.1.1
remote: Installing execjs 2.6.0
remote: Installing thor 0.19.1
remote: Installing multi_json 1.11.2
remote: Using bundler 1.9.7
remote: Installing rails_serve_static_assets 0.0.4
remote: Installing bcrypt 3.1.10
remote: Using rdoc 4.2.0
remote: Installing sass 3.4.19
remote: Installing rails_stdout_logging 0.0.4
remote: Installing tzinfo 1.2.2
remote: Installing tilt 2.0.1
remote: Installing rack-test 0.6.3
remote: Installing sprockets 3.4.0
remote: Installing mail 2.6.3
remote: Installing coffee-script 2.4.1
remote: Installing uglifier 2.7.2
remote: Installing sdoc 0.4.1
remote: Installing rails_12factor 0.0.3
remote: Installing activesupport 4.2.4
remote: Installing rails-deprecated_sanitizer 1.0.3
remote: Installing globalid 0.3.6
remote: Installing activemodel 4.2.4
remote: Installing jbuilder 2.3.2
remote: Installing activejob 4.2.4
remote: Installing activerecord 4.2.4
remote: Installing pg 0.18.3
remote: Installing nokogiri 1.6.6.2
remote: Installing loofah 2.0.3
remote: Installing rails-dom-testing 1.0.7
remote: Installing rails-html-sanitizer 1.0.2
remote: Installing actionview 4.2.4
remote: Installing actionpack 4.2.4
remote: Installing actionmailer 4.2.4
remote: Installing sprockets-rails 2.3.3
remote: Installing railties 4.2.4
remote: Installing coffee-rails 4.1.0
remote: Installing jquery-rails 4.0.5
remote: Installing rails 4.2.4
remote: Installing sass-rails 5.0.4
remote: Installing turbolinks 2.5.3
remote: Bundle complete! 15 Gemfile dependencies, 52 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 (25.95s)
remote: Cleaning up the bundler cache.
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: I, [2015-11-06T07:11:59.545861 #1061] INFO -- : Writing /tmp/build_3696c7b0356812fdd8d08d263aa37657/public/assets/application-51bf096d402cefc1025d96872785d4cf537dbf0073f5dba9572ac26b890c09ae.js
remote: I, [2015-11-06T07:11:59.560330 #1061] INFO -- : Writing /tmp/build_3696c7b0356812fdd8d08d263aa37657/public/assets/application-e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855.css
remote: Asset precompilation completed (3.72s)
remote: Cleaning assets
remote: Running: rake assets:clean
remote:
remote: ###### WARNING:
remote: No Procfile detected, using the default web server (webrick)
remote: https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for Ruby -> console, rake, web, worker
remote:
remote: -----> Compressing... done, 30.0MB
remote: -----> Launching... done, v5
remote: https://rocky-badlands-5818.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
To https://git.heroku.com/rocky-badlands-5818.git
* [new branch] master -> master
budi#Lenovo:~/blog$ heroku open
Opening rocky-badlands-5818... done
(process:16901): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
It seems, that your application uses database. After creating herokuapp database is not ready yet - you have to "tell it" to use your migration files.
To do this, in terminal run heroku run rake db:migrate
I was developing an app on Ruby on Rails. I was successfully able to add, commit and push it to heroku using
$ git push heroku master
Later I switched back to previous commit using
git reset --head Head^1
I did all the changes and pushed it back to heroku. When I opened my app, no changes were made and it was still on a previous version. Changes are being shown in my localhost but not on the server.
I restarted my app using
$ heroku restart -app app-name
And here is the output when I restarted:
Restarting dynos... done
This is the output when I pushed my app to heroku after restarting
Counting objects: 9, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (5/5), done.
Writing objects: 100% (5/5), 435 bytes | 0 bytes/s, done.
Total 5 (delta 4), 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.0
remote: -----> Installing dependencies using 1.9.7
remote: Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote: Using i18n 0.7.0
remote: Using json 1.8.2
remote: Using rake 10.4.2
remote: Using minitest 5.5.1
remote: Using thread_safe 0.3.4
remote: Using builder 3.2.2
remote: Using erubis 2.7.0
remote: Using mini_portile 0.6.2
remote: Using rack 1.6.0
remote: Using mime-types 2.4.3
remote: Using arel 6.0.0
remote: Using execjs 2.3.0
remote: Using bcrypt 3.1.10
remote: Using sass 3.4.13
remote: Using net-ssh 2.9.2
remote: Using coffee-script-source 1.9.1
remote: Using thor 0.19.1
remote: Using orm_adapter 0.5.0
remote: Using ffi 1.9.8
remote: Using tilt 1.4.1
remote: Using hike 1.2.3
remote: Using multi_json 1.10.1
remote: Using kgio 2.9.3
remote: Using libv8 3.16.14.7
remote: Using mimemagic 0.3.0
remote: Using subexec 0.2.3
remote: Using pg 0.18.1
remote: Using bundler 1.9.7
remote: Using rails_serve_static_assets 0.0.4
remote: Using rails_stdout_logging 0.0.3
remote: Using raindrops 0.13.0
remote: Using ref 1.0.5
remote: Using dropbox-sdk 1.6.4
remote: Using tzinfo 1.2.2
remote: Using nokogiri 1.6.6.2
remote: Using rack-test 0.6.3
remote: Using warden 1.2.3
remote: Using mail 2.6.3
remote: Using autoprefixer-rails 5.1.7
remote: Using uglifier 2.7.0
remote: Using net-sftp 2.1.2
remote: Using coffee-script 2.3.0
remote: Using figaro 1.1.0
remote: Using sys-uname 0.9.0
remote: Using haml 4.0.6
remote: Using sprockets 2.12.3
remote: Using rails_12factor 0.0.3
remote: Using unicorn 4.8.3
remote: Using therubyracer 0.12.1
remote: Using activesupport 4.2.0
remote: Using bootstrap-sass 3.3.3
remote: Using mini_magick 3.8.0
remote: Using loofah 2.0.1
remote: Using imagemagick-binaries 6.8.7.5.1
remote: Using rails-html-sanitizer 1.0.1
remote: Using rails-deprecated_sanitizer 1.0.3
remote: Using globalid 0.3.3
remote: Using activemodel 4.2.0
remote: Using climate_control 0.0.3
remote: Using jbuilder 2.2.8
remote: Using pundit 0.3.0
remote: Using rails-dom-testing 1.0.5
remote: Using activejob 4.2.0
remote: Using activerecord 4.2.0
remote: Using carrierwave 0.10.0
remote: Using cocaine 0.5.7
remote: Using actionview 4.2.0
remote: Using polyamorous 1.1.0
remote: Using carrierwave-dropbox 1.2.1
remote: Using carrierwave-ftp 0.2.8
remote: Using paperclip 4.3.0
remote: Using actionpack 4.2.0
remote: Using paperclip-dropbox 1.3.2
remote: Using actionmailer 4.2.0
remote: Using railties 4.2.0
remote: Using sprockets-rails 2.2.4
remote: Using kaminari 0.16.3
remote: Using ransack 1.6.3
remote: Using simple_form 3.1.0
remote: Using mail_form 1.5.1
remote: Using coffee-rails 4.1.0
remote: Using responders 2.1.0
remote: Using font-awesome-rails 4.3.0.0
remote: Using jquery-rails 4.0.3
remote: Using sass-rails 5.0.1
remote: Using lightbox2-rails 2.7.1
remote: Using rails 4.2.0
remote: Using turbolinks 2.5.3
remote: Using devise 3.4.1
remote: Using jquery-datatables-rails 3.2.0
remote: Using devise_invitable 1.4.1
remote: Using upmin-admin 0.1.01
remote: Bundle complete! 34 Gemfile dependencies, 92 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 (1.07s)
remote: Cleaning up the bundler cache.
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: Asset precompilation completed (5.58s)
remote: Cleaning assets
remote: Running: rake assets:clean
remote:
remote: ###### WARNING:
remote: No Procfile detected, using the default web server (webrick)
remote: https://devcenter.heroku.com/articles/ruby-default-web-server
remote:
remote: -----> Discovering process types
remote: Procfile declares types -> (none)
remote: Default types for Ruby -> console, rake, web, worker
remote:
remote: -----> Compressing... done, 155.5MB
remote: -----> Launching... done, v123
remote: https://app-name.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy.... done.
To https://git.heroku.com/app-name.git
6cb4846..275460b master -> master
Restart your heroku app and check again. Here is the command
heroku restart -a app_name
Later I switched back to previous commit using
git reset --head Head^1
Since you've rewrote history, a normal push won't be accepted as it is not a fast forward.
There are two possible solutions:
Force push your current branch:
$ git push -f heroku master
If all what you want is to have the previous live version back, run a rollback:
$ heroku rollback