Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploy raise error "Don't know how to build task 'assets:precompile'" (Capistrano)

Does anyone ever got this error after run :

cap production deploy

I'm Using capistrano : Capistrano Version: 3.6.1 (Rake Version: 11.3.0)

Here is the log :

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: rake exit status: 1
rake stdout: rake aborted!
Don't know how to build task 'assets:precompile' (see --tasks)
/home/deploy/microwave-api/shared/bundle/ruby/2.3.0/gems/rake-11.3.0/exe/rake:27:in `<top (required)>'
.
.
.
/home/deploy/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/deploy/.rvm/gems/ruby-2.3.0/gems/bundler-1.13.6/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/deploy/.rvm/gems/ruby-2.3.0/bin/ruby_executable_hooks:15:in `<main>'
(See full trace by running task with --trace)
rake stderr: Nothing written

SSHKit::Command::Failed: rake exit status: 1
rake stdout: rake aborted!
Don't know how to build task 'assets:precompile' (see --tasks)enter code here
like image 275
Khalid Avatar asked Dec 09 '16 02:12

Khalid


1 Answers

Sounds like you probably don't have Sprockets set up (an API only application?).

In your Capfile, you probably have something like:

require 'capistrano/rails'

That line actually requires a file which looks like:

require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'

So you can replace the former line with just:

require 'capistrano/rails/migrations'

and the asset precompilation will no longer be run.

As mentioned above, this assumes that you don't actually want to use the asset pipeline. If this isn't the case, the issue is that you aren't including Sprockets and you need to look into that. I'd generate a new rails app and compare your Gemfile and config/application.rb.

like image 195
will_in_wi Avatar answered Sep 21 '22 20:09

will_in_wi