Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deploy fails with 'cannot create directory' #205

Closed
luizkowalski opened this issue Jul 3, 2014 · 3 comments
Closed

Deploy fails with 'cannot create directory' #205

luizkowalski opened this issue Jul 3, 2014 · 3 comments

Comments

@luizkowalski
Copy link

I'm trying to deploy an app with Mina, but I'm getting this error:

-----> Skipping asset precompilation
       $ cp -R "/home/deploy/integracao/current/public/assets" "./public/assets"
       cp: cannot create directory ‘./public/assets’: No such file or directory
 !     ERROR: Deploy failed.

The first time I deployed, everything worked fine. On the second pass (and so on) I'm seeing the error above.
This is my deploy.rb

require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
require 'mina/rbenv'  # for rbenv support. (http://rbenv.org)

set :domain, '192.168.0.87'
set :deploy_to, '/home/deploy/integracao'
set :repository, 'https://github.com...'
set :branch, 'master'

set :rails_env, 'production'

set :shared_paths, ['config/database.yml', 'log', 'config/application.yml']


 set :user, 'deploy'    # Username in the server to SSH to.

task :environment do
  # If you're using rbenv, use this to load the rbenv environment.
  # Be sure to commit your .rbenv-version to your repository.
  invoke :'rbenv:load'

  # For those using RVM, use this to load an RVM version@gemset.
  # invoke :'rvm:use[ruby-1.9.3-p125@default]'
end

# Put any custom mkdir's in here for when `mina setup` is ran.
# For Rails apps, we'll make some of the shared paths that are shared between
# all releases.
task :setup => :environment do
  queue! %[mkdir -p "#{deploy_to}/shared/log"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/log"]

  queue! %[mkdir -p "#{deploy_to}/shared/config"]
  queue! %[chmod g+rx,u+rwx "#{deploy_to}/shared/config"]

  queue! %[touch "#{deploy_to}/shared/config/database.yml"]
  queue  %[echo "-----> Be sure to edit 'shared/config/database.yml'."]
end

desc "Deploys the current version to the server."
task :deploy => :environment do
  deploy do
    # Put things that will set up an empty directory into a fully set-up
    # instance of your project.
    invoke :'git:clone'
    invoke :'deploy:link_shared_paths'
    invoke :'bundle:install'
    invoke :'rails:db_migrate'
    invoke :'rails:assets_precompile'

    to :launch do
      queue "touch #{deploy_to}/tmp/restart.txt"
    end
  end
end

I had to change to invoke :'rails:assets_precompile:force' in order to skip this error

@qen
Copy link
Contributor

qen commented Jul 3, 2014

  • login as deploy user in your server
  • check if you can create the directory /home/deploy/integracao/current/public/assets

@luizkowalski
Copy link
Author

as I said, I changed the precompile to :force and this error is not happening anymore...

@gabskoro
Copy link
Member

This is now fixed, can you please pull the new version from github and test it?

@d4be4st d4be4st closed this as completed Jul 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants