Capistrano deploy fails on rake assets:precompile - ruby-on-rails

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.

Related

No such file or directory -- rake [PROJECT-FOLDER-NAME] init ... (LoadError)

I have rails 3.2.0 application and ruby is - 2.1.2.
When I'm running below command
rake assets:precompile
I'm getting error like
.rvm/rubies/ruby-2.1.2/bin/ruby: No such file or directory -- rake [PROJECT-FOLDER-NAME] init ... (LoadError)
rake aborted!
What's wrong with Precompile not getting so please Help me

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.

Precompiling assets with capistrano gives error during deployment

I am trying to deploy my rails app to a digital ocean server using the capistrano gem, and I'm getting the error :
The deploy has failed with an error: #<SSHKit::Command::Failed: RAILS_ENV= bundle exec rake assets:precompile exit status: 256
RAILS_ENV= bundle exec rake assets:precompile stdout: Nothing written
RAILS_ENV= bundle exec rake assets:precompile stderr: rake aborted!
ActiveRecord::AdapterNotSpecified: database configuration does not specify adapter
Even though the local config/database.yml and shared/config/database.yml file on the server are both configured, and have production databases set.
In case I run the rake db:create command on the server, it does create the database successfully. So, can't really find the issue.
Using rails 4.0.2, ruby 2.1.0, capsitrano 3.1.0
Sorry - I don't have the rep to comment.
It's a bit short on detail about your deploy configuration, you probably need to share.
RAILS_ENV= bundle exec rake assets:precompile stdout: Nothing written
Would suggest to me that there is no RAILS_ENV set. I don't think there is an issue with the database .yml
Infact - this post might be relevant: Capistrano 3, Rails 4, database configuration does not specify adapter

rake assets:precompile error message: No such file or directory -- ruby

I'm following along to the excellent Michael Hartl Rails book (Rails 3.2) but am getting an error when attempting to run the command:
rake assets:precompile
The error is as follows:
/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/bin/ruby ruby /Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/rake assets:precompile assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/bin/ruby: No such file or directory -- ruby /Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/rake assets:precompile (LoadError)
rake aborted!
Command failed with status (1): [/Users/Jamie/.rvm/rubies/ruby-1.9.3-p448/b...]
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/gems/actionpack- 3.2.14/lib/sprockets/assets.rake:12:in `ruby_rake_task'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/gems/actionpack-3.2.14/lib/sprockets/assets.rake:21:in `invoke_or_reboot_rake_task'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/gems/actionpack-3.2.14/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/ruby_executable_hooks:14:in `eval'
/Users/Jamie/.rvm/gems/ruby-1.9.3-p448#movies/bin/ruby_executable_hooks:14:in `<main>'
Tasks: TOP => assets:precompile
Thanks for your help!
I fixed this by reverting back from p448 to p392 and then running:
rvm ruby-1.9.3-p392#global do gem install executable-hooks
as suggested by mpapis here: Rake assets:precompile cannot find ruby
I was trying to run the rake command within ubuntu and was getting ruby_executable_hooks error. I resolved it with:
rvm all do gem install executable-hooks
This seems to be an issue with 1.9.3-p448. Today I updated ruby from p392 to p448 on my server and started getting this error. I reverted back to p392 and precompilation of assets is working again.
Perhaps try installing a version before p448 and try again.
After working with this a bit more, I found that emptying and reinstalling my gems caused precompilation to start working again:
$ rvm gemset empty
$ bundle install
$ rake assets:precompile RAILS_ENV=production

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