I am trying to deploy Heroku but I still have same error:
rake aborted!
remote: Sass::SyntaxError: Invalid CSS after ".../sass-lang.com/": expected "{", was ""
remote: /tmp/build_fa42ee7d4fc8aec796bb9d2efab757a3/app/assets/stylesheets/todo_tasks.scss:4
I have removed todo_tasks.scss, it is no longer in the app on github but still I have this error,
I tried even installing heroku one more time ^^
What should I do?
Related
I am trying to upload my web app on heroku, but the following error occurs.
(I'm coding with cloud 9 IDE)
$ git push heroku master
.....
remote: -----> Installing node-v10.14.1-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, [2019-05-22T02:13:47.373334 #1766] INFO -- : Writing
/tmp/build_fcc84922ee6a02bfc05a163c871d0548/public/assets/noimage-
3aa3997354b4e9c37f379deb61626f55ade493078d1b42dcefe4a3ccbed34106.jpg
remote: rake aborted!
remote: ExecJS::RuntimeError: SyntaxError: Unexpected character '`'
remote: JS_Parse_Error.get ((execjs):3538:621)
remote: (execjs):4060:48
remote: (execjs):1:102
.....
remote: !
remote: ! Precompiling assets failed.
remote: !
remote: ! Push rejected, failed to compile Ruby app.
First of all, It says that "there Yarn executable was not detected in the system", but it is properly downloaded if I check it with yarn -v.
Also, ExecJS :: RuntimeError: SyntaxError: Unexpected character '`' error seems to be that es6 is not recognized, as a solution
config.assets.js_compressor =: uglifier
config.assets.js_compressor = Uglifier.new (harmony: true)
Changed to This seems to be able to read es6. But the above error still persists.
Also, if I run 'rake assets: precompile RAILS_ENV = production' on the console, it runs normally without error.
Thanks.
Try to add this gem in your gem file.
gem 'therubyracer'
Try this link:
Syntax error when deploying Rails app to Heroku: ExecJS::RuntimeError: SyntaxError: Unexpected character
config.assets.js_compressor =: uglifier
=: uglifier
space between : and uglifier?
should be = :uglifier
and try to use precompile command without string RAILS_ENV = production
because Heroku installs production mode by default. if I'm not mistaken
Try this, Go to heroku dashboard on their website, select your app, click on the gear icon (the settings), scroll down until you see “build packs” add ruby and nodejs buildpacks, and make sure the order is that that nodejs comes first in the list, and then ruby (from top to bottom).
If that doesn’t work, can you clarify how you are triggering the compilation of your JS?
Explanation: I’ve seen this error before(with npm, not yarn), essentially you want herokus nodejs buildpack to take care of JS compiling, the one rails has built in seems to not be compatible with their system.
When I put $git push heroku master, I got an argument error:
remote: -----> Preparing app for Rails asset pipeline
remote: Running: rake assets:precompile
remote: ArgumentError: secret_key_base for production environment must be a type of String
remote: /tmp/build_19076210a01025325310b08d032af424/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:583:invalidate_secret_key_base'
remote: /tmp/build_19076210a01025325310b08d032af424/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:432:in secret_key_base'
remote: /tmp/build_19076210a01025325310b08d032af424/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:176:inkey_generator'
remote: /tmp/build_19076210a01025325310b08d032af424/vendor/bundle/ruby/2.5.0/gems/railties-5.2.2/lib/rails/application.rb:205:in `message_verifier'
.......................
My Rails version is 5.2 and which has new encrypt system filed in config/credentials.yml.enc. I guess this configuration makes this heroku error.
No one has this question and describe how to solve this error.
Could you please help me how to solve this error? Thanks.
https://waiyanyoon.com/deploying-rails-5-2-applications-with-encrypted-credentials-using-capistrano/
also before pushing to heroku try to compile assets in PRODUCTION mode locally to see if everything works.
After try to deploy a simple rails test app into heroku, in the terminal poped up this
Uglifier::Error: Name expected
in the middle of the assets compilation.
i've searched and i did not find anything related to this, so someone ahs any idea this name expected is about?
remote: I, [2018-04-27T20:10:19.341334 #1686] INFO -- : Writing /tmp/build_171697f13e39a581026e766b205b8f86/public/assets/white-774a5ae6a58216b107623782ce2e1820ebb64f9d294cad32e132c086866f3dd2.png
remote: rake aborted!
remote: Uglifier::Error: Name expected
remote:
/tmp/build_171697f13e39a5810263766b205b8f86/vendor/bundle/ruby/2.3.0/gems/uglifier-4.1.4/lib/uglifier.rb:234:in `parse_result'
Make sure your asset pre-compilation works locally
bundle exec rake assets:precompile
If there are any errors that should help you find where they are happening.
Also see possible duplicate of Heroku Precompiling Assets Failed
I am attempting to push to Heroku and am getting the following error:
remote: -----> Detecting rake tasks
remote: sh: 2: Syntax error: Unterminated quoted string
remote: sh: 2: Syntax error: Unterminated quoted string
remote: !
remote: ! Could not detect rake tasks
remote: ! ensure you can run `$ bundle exec rake -P` against your app
remote: ! and using the production group of your Gemfile.
remote: ! rake aborted!
remote: ! Errno::ENOENT: No such file or directory # rb_sysopen - /tmp/build_0ea6e71e6fa31065be1c41a3cb6aaacb/config/application.yml
Running bundle exec rake -P works without any errors.
application.yml is part of my .gitignore, so I'm confused why the error message has to do with this file and why it's preventing me from pushing to Heroku.
Any ideas?
It turned out to be a silly mistake but posting here in case it's useful to anyone else - I was pushing the wrong branch to heroku. Once I corrected the branch name, it worked perfectly.
I'm having a hard time diagnosing why the rake assets:precompile function is failing when pushing to heroku.
Here's an excerpt of my failure message:
remote: I, [2015-09-27T23:13:38.130174 #1566] INFO -- : Writing /tmp/build_ece222744980130b2be8b337003ec99c/public/assets/application-c7927379441221ea1d8a9e016fe470ae6acdbe343094861d91f0dade373344d4.js
remote: rake aborted!
remote: Sass::SyntaxError: Invalid CSS after " */": expected "}", was ""
remote: (sass):7791
remote: /tmp/build_ece222744980130b2be8b337003ec99c/vendor/bundle/ruby/2.0.0/gems/sass-3.4.18/lib/sass/scss/parser.rb:1162:in `expected'
Obviously it is failing due to some JS syntax. I have several Javascripts that I used in conjuction with the Signature Pad application, but only edited a few. In an attempt to diagnose, I removed the 'suspect' edited ones and retried my push, to no avail. I also completed the rake assets:precompile command on my local dev machine, which completed without error.
Does anyone have any advice on how I might narrow my search down?
Found my error. I left out a closing } in one of my CSS statements when I added in print media type