Can't make asset precompile before pushing to heroku - ruby-on-rails

I need to make it to make my jQuery working on Heroku.
Here is my console:
$ rake assets:precompile
c:/Ruby192/bin/ruby.exe c:/Ruby192/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
rake aborted!
Access denied for user 'root'#'localhost' (using password: NO)
Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [c:/Ruby192/bin/ruby.exe c:/Ruby192/bin/rak...]
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
When I try do run:
$ assets:precompile
sh: assets:precompile: command not found
EDITED:
Also I added this line to application.rb:
config.assets.initialize_on_precompile = false

You have mentioned wrong username and password of mysql. Some gems which need database access for assets:precompile.

Related

Postgresql & RoR issue

I'm having issues installing the SOLIDUS gem for my rails app. I followed the instructions from GitHub but when i run the command bundle exec rake db:migrate i get the error:
mannay:testsite mannay$ bundle exec rake db:migrate
rake aborted!
PG::ConnectionBad: fe_sendauth: no password supplied
/usr/local/var/rbenv/versions/2.5.0/bin/bundle:23:in `load'
/usr/local/var/rbenv/versions/2.5.0/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
I've tried adding username: mannay to my database.yml and even password: but it doesn't work. I thought maybe i've added a password that i don't remember, so i opened postgressapp, and tested
ALTER USER mannay with password 'new_password';
but it doesn't change anything.
Any ideas?

deploying a rails app with capistrano

when executing: cap production deploy:initial
I get an error message:
** Execute deploy:assets:precompile
00:08 deploy:assets:precompile
/usr/local/rvm/bin/rvm default do bundle exec rake assets:precompile
rake aborted!
LoadError: cannot load such file -- single_test/tasks
/home/deploy/apps/A_W_Creamery/shared/bundle/ruby/2.2.0/gems/activesupport-4.2.5/lib/active_support/dependencies.rb:274:i…
It seems like, you previously have installed Single test gem and now you remove it, but you forgot to remove command:
require 'single_test/tasks'
from your Rakefile.

Capistrano deploy fails on rake assets:precompile

When executing cap production deploy I get the error:
[25307399] Command: RAILS_ENV=production bundle exec rake assets:precompile
cap aborted!
SSHKit::Command::Failed: RAILS_ENV=production bundle exec rake assets:precompile stdout: Nothing written
RAILS_ENV=production bundle exec rake assets:precompile stderr: rake aborted!
LoadError: cannot load such file -- sass/script/node
/Users/me/rails/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support /dependencies.rb:229:in `require'
Checking similar questions got me to try and debug by running bundle exec rake assets:precompile on my local machine and it fails with the same error:
rake aborted!
LoadError: cannot load such file -- sass/script/node
/Users/evan/rails/do-indie/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.3/lib/active_support /dependencies.rb:229:in `require'
There are hints that it's an issue with the sass gem, so I uninstalled all my sass gems and reinstalled them. Same error. Then I did some more digging and saw this might be an issue with sass 3.3.0, so I installed v 3.2.13 but I'm still getting the cannot load such file -- sass/script/node and not sure how to keep trouble shooting this.

Ruby on Rails Rake assets:precompile error - Command failed with status (1) - CScript Error: Execution of the Windows Script Host failed

Okay so time after time we've all seen question about Rake assets:precompile error. I've tried multiple methods, I looked at the following SO question Ruby on Rails Rake assets:precompile error and tried multiple methods of even doing the following: config.assets.compile = true and then running rake assets:precompile --trace RAILS_ENV=production. However I noticed that when I tried to do the following:
rake assets:precompile RAILS_ENV=production I got the following error:
rake aborted!
CScript Error: Execution of the Windows Script Host failed. (0x800A0007)
C:\Users\home\Desktop>cd MIUK_Portal
C:\Users\home\Desktop\MIUK_Portal>rake assets:precompile
RAILS_ENV=production C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe
C:/RailsInstaller/Ruby1.9.3/bin/rake assets:precompile:all
RAILS_ENV=production RAILS_GROUPS=assets rake aborted! 795: unexpected
token at
'C:\Users\home\AppData\Local\Temp\execjs20121221-5484-1atk9yx.js(2, 3)
Microsoft JScript runtime error: Out of memory
' (in
C:/Users/home/Desktop/MIUK_Portal/app/assets/javascripts/application.js)
Tasks: TOP => assets:precompile:primary (See full trace by running
task with --trace) rake aborted! Command failed with status (1):
[C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe C...]
Tasks: TOP => assets:precompile (See full trace by running task with
--trace)
Has anyone encountered this issue? How do you overcome this?
Update
Okay apparently from looking at the error it clearly is stating that
:\Users\home\AppData\Local\Temp\execjs20121221-5484-1atk9yx.js(2, 3)
Microsoft JScript runtime error: Out of memory
So I'm now wondering how to resolve this? Any ideas? Further to this I noticed that someone did encounter the similar issue: CS Script issue but this was unresolved:
So I am asking if anyone out there has had the same issue.
This was what I did, and it worked for me. I installed node.js first in my system, and then ran the following command bundle exec rake assets:precompile.
I was able to solve this issue by transferring the project into a Linux environment (Ubuntu) and running the bundle exec rake assets:precompile. It appeared to work, I believe this sort of issue is something to do with windows. If starting any kind of development to do with RoR stick to Linux.

Why jQuery validation plugin is not working on Heroku?

jQuery validation is working locally, but it doesn't on Heroku.
There is no errors about it in console. What should I do ?
EDITED
den#DENYS /D/myapp (master)
$ RAILS_ENV=production bundle exec rake assets:precompile
c:/Ruby192/bin/ruby.exe c:/Ruby192/bin/rake assets:precompile:all RAIL
uction RAILS_GROUPS=assets
rake aborted!
Access denied for user 'root'#'localhost' (using password: NO)
Tasks: TOP => environment
(See full trace by running task with --trace)
rake aborted!
Command failed with status (1): [c:/Ruby192/bin/ruby.exe c:/Ruby192/bi
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
Have you precompiled your assets before pushing to heroku?
RAILS_ENV=production bundle exec rake assets:precompile
You can find more information here.
If it doesn't solve your problem, please provide the heroku logs in your question.

Resources