Skip to content

Instantly share code, notes, and snippets.

@richardsondx
Last active December 10, 2015 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richardsondx/10092890 to your computer and use it in GitHub Desktop.
Save richardsondx/10092890 to your computer and use it in GitHub Desktop.
Capistrano deploy:assets:precompile issue rake stdout: Nothing written
# Load DSL and Setup Up Stages
require 'capistrano/setup'
# Includes default deployment tasks
require 'capistrano/deploy'
# 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/rails'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
# require 'sshkit'
# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, 'ExampleApp'
set :repo_url, 'git@github.com:user/exampleapp.git'
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
# Default deploy_to directory is /var/www/my_app
set :deploy_to, 'server.example.com'
# Default value for :scm is :git
set :rvm_ruby_version, 'ruby-2.0.0-p353'
# Default value for :log_level is :debug
set :log_level, :info
# 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}
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
set :default_env, { rvm_bin_path: '~/.rvm/bin' }
# Default value for keep_releases is 5
set :keep_releases, 20
# SSHKit.config.output_verbosity = :debug
SSHKit.config.command_map[:rake] = "bundle exec rake"
# SSHKit.config.command_map[:rails] = "bundle exec rails"
# set :normalize_asset_timestamps, %{public/images public/javascripts public/stylesheets}
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')
# run "touch #{current_path}/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
** Execute deploy:updated
** Invoke deploy:compile_assets (first_time)
** Invoke deploy:set_rails_env (first_time)
** Execute deploy:set_rails_env
** Execute deploy:compile_assets
** Invoke deploy:assets:precompile (first_time)
** Execute deploy:assets:precompile
INFO [92b964f1] Running /usr/local/rvm/bin/rvm ruby-2.0.0-p353 do bundle exec rake assets:precompile on
cap aborted!
rake stdout: Nothing written
rake stderr: Nothing written
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/command.rb:94:in `exit_status='
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:142:in `block (4 levels) in _execute'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:551:in `call'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:551:in `do_request'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:561:in `channel_request'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:205:in `process'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:269:in `wait'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:164:in `block (2 levels) in _execute'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:514:in `call'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:205:in `process'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:166:in `block in _execute'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `tap'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `_execute'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-rails-1.1.1/lib/capistrano/tasks/assets.rake:59:in `block (6 levels) in <top (required)>'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/backends/abstract.rb:89:in `with'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-rails-1.1.1/lib/capistrano/tasks/assets.rake:58:in `block (5 levels) in <top (required)>'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/backends/abstract.rb:81:in `within'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-rails-1.1.1/lib/capistrano/tasks/assets.rake:57:in `block (4 levels) in <top (required)>'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/evenix/.rvm/gems/ruby-2.0.0-p353/gems/sshkit-1.3.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => deploy:assets:precompile
The deploy has failed with an error: #<SSHKit::Command::Failed: rake stdout: Nothing written
rake stderr: Nothing written
>
** Invoke deploy:failed (first_time)
** Execute deploy:failed
gem 'capistrano', '~> 3.1.0'
gem 'capistrano-rails', '~> 1.1'
# gem 'capistrano-rbenv', '~> 2.0'
# gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-bundler', '~> 1.1.0'
gem 'capistrano-rvm'
# gem 'rvm-capistrano'
# deploy/production.rb
# has the server configuration and
set :rails_env, 'production'
@muhaha3
Copy link

muhaha3 commented Oct 15, 2014

could u tell me how you solve this?

@heaven
Copy link

heaven commented Nov 15, 2014

Also getting this error.

@axsuul
Copy link

axsuul commented Dec 10, 2014

This means there's Rails environment initialization errors.

@cfjohan
Copy link

cfjohan commented Dec 10, 2014

I had a similar error a minute ago. In my case I had a migration in the repo that had not been run on the production db, so maybe capistrano had problems migrating. I migrated manually on the server and deploy worked fine after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment