title: Capistrano 3 not deploy and show this error SSHKit::Command::Failed: rake stdout: Nothing written
body: <p>I have used rails 4 and Capistrano 3. When i depoly with Capistrano fail during rake assets:precompile and show following error</p>
  
  <pre><code> INFO [1c9c2531] Running ~/.rvm/bin/rvm default do bundle exec rake assets:precompile on 107.170.67.113
  cap aborted!
  SSHKit::Command::Failed: rake stdout: Nothing written
  rake stderr: Nothing written
  
  Tasks: TOP =&gt; deploy:assets:precompile
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>I'm newbie on rails and server setup so where am i missing.I don't know </p>
  
  <p>Here my depoly.rb</p>
  
  <pre><code>SSHKit.config.command_map[:rake] ||= "bundle exec rake"
  
  # config valid only for Capistrano 3.1
  lock '3.0.1'
  
  
  set :application, 'PCA'
  set :repo_url, 'git@github.com:3lackRos3/pca.git'
  
  # Default branch is :master
  # ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }.call
  
  # Default deploy_to directory is /var/www/my_app
   set :deploy_to, '/home/pca/app/pca'
   set :deploy_user, 'pca'
  
   set :rvm_ruby_string, ENV['GEM_HOME'].gsub(/.*\//,"")
   set :rvm_type, :user
   set :rvm_bin_path, '/usr/local/rvm/bin'
  
  
  #  set :default_environment, {
  #   'RBENV_ROOT' =&gt; '/usr/local/rbenv',
  #   'PATH' =&gt; "/usr/local/rbenv/shims:/usr/local/rbenv/bin:$PATH"
  # }
  
  # set :default_environment, {
  #   'PATH' =&gt; "$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH"
  # }
  # set :rbenv_ruby, "2.1.1"
  
   #    set :rbenv_ruby_dir, -&gt; { "#{fetch(:rbenv_path)}/versions/#{fetch(:rbenv_ruby)}" }
   #    set :rbenv_map_bins, %w{rake gem bundle ruby rails}
  # Default value for :scm is :git
   set :scm, :git
   set :ssh_options, { forward_agent: true }
   #set :ssh_options, proxy: Net::SSH::Proxy::Command.new('ssh  pca@107.170.67.113  -W %h:%p')
  
  # Default value for :format is :pretty
  # set :format, :pretty
  
  set :log_level, :info
  # Default value for :log_level is :debug
  # set :log_level, :debug
  
  # Default value for :pty is false
  set :pty, true
  
  
  # Default value for :linked_files is []
  # set :linked_files, %w{config/database.yml}
  
  # Default value for linked_dirs is []
   set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
  
  
  
  
   # SSHKit.config.command_map[:rake].sub!(/\(.*\)rake/, "\1bundle exec rake")
  
  # Default value for default_env is {}
  # set :default_env, { path: "/opt/ruby/bin:$PATH" }
  
  # Default value for keep_releases is 5
  # set :keep_releases, 20
  after "deploy", "deploy:cleanup"
  
  namespace :deploy do
  
    desc 'Restart application'
    task :restart do
  #    on roles(:app), in: :sequence, wait: 5 do
        # Your restart mechanism here, for example:
  #       execute :touch, release_path.join('tmp/restart.txt')
  #    end
    end
  
    after :publishing, :restart
  
    after :restart, :clear_cache do
  #    on roles(:web), in: :groups, limit: 3, wait: 10 do
        # Here we can do anything such as:
        # within release_path do
        #   execute :rake, 'cache:clear'
        # end
  #    end
    end
   after :finishing, 'deploy:cleanup'
  end
  </code></pre>
  
  <p>Here my capfile</p>
  
  <pre><code># Load DSL and Setup Up Stages
  require 'capistrano/setup'
  
  # Includes default deployment tasks
  require 'capistrano/deploy'
  #require 'rvm1/capistrano3'
  #require 'capistrano/rvm'
  # Includes tasks from other gems included in your Gemfile
  #
  # For documentation on these, see for example:
  #
  #   https://github.com/capistrano/rvm
  #   https://github.com/capistrano/rbenv
  #   https://github.com/capistrano/chruby
  #   https://github.com/capistrano/bundler
  #   https://github.com/capistrano/rails
  #
  require 'capistrano/rvm'
  # require 'capistrano/rbenv'
  # require 'capistrano/chruby'
   require 'capistrano/bundler'
   require 'capistrano/rails/assets'
   require 'capistrano/rails/migrations'
   require 'capistrano/rails'
  
  # Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
  Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
  </code></pre>
  
  <p>I have run bundle exec cap production deploy:check and
        my output is </p>
  
  <pre><code>  INFO [ecf1a980] Running /usr/bin/env mkdir -p /tmp/PCA/
    INFO [ecf1a980] Finished in 4.848 seconds with exit status 0 (successful).
    INFO Uploading /tmp/PCA/git-ssh.sh 100.0%
    INFO [8e7210f6] Running /usr/bin/env chmod +x /tmp/PCA/git-ssh.sh on serverip
    INFO [8e7210f6] Finished in 0.639 seconds with exit status 0 (successful).
    INFO [4c538c51] Running /usr/bin/env mkdir -pv /home/pca/app/pca/shared /home/pca/app/pca/releases
   INFO [4c538c51] Finished in 4.480 seconds with exit status 0 (successful).
   INFO [d6a7dce6] Running /usr/bin/env mkdir -pv /home/pca/app/pca/shared/bin /home/pca/app/pca/shared/log /home/pca/app/pca/shared/tmp/pids /home/pca/app/pca/shared/tmp/cache /home/pca/app/pca/shared/tmp/sockets /home/pca/app/pca/shared/vendor/bundle /home/pca/app/pca/shared/public/system
   INFO [d6a7dce6] Finished in 4.507 seconds with exit status 0 (successful).
  </code></pre>
  
  <p>Anybody help me..</p>
  
  <p>thanks!</p>