RailsCasts Pro episodes are now free!

Learn more or hide this

Andrey Esaulov's Profile

GitHub User: andremaha

Site: http://object-oriented-php.com

Comments by Andrey Esaulov

Avatar

Problem

I've been fighting with that one for a while now. That is the cry for help. As suggested I've going through all the commands and executed them on the remote server.
The command that fails on the server is:

sh -c "rm -rf /home/deployer/apps/blog/releases/20120726142915/public/assets &&\\\n        mkdir -p /home/deployer/apps/blog/releases/20120726142915/public &&\\\n        mkdir -p /home/deployer/apps/blog/shared/assets &&\\\n        ln -s /home/deployer/apps/blog/shared/assets /home/deployer/apps/blog/releases/20120726142915/public/assets"

It says: \n not found. As far as I can tell, it doesn't like the new lines. When I put them away manually - everything goes OK.

The interesting this is - the deployment script seem to execute this command OK, and it is the next one it stables upon (bundle install). Although when executing manually on the sever - bundles get installed OK.

What can it be? And how, and where, do I edit those new lines "\\n" out?

Complete Output:

λ config → λ git master → cap deploy:cold
  * executing `deploy:cold'
  * executing `deploy:update'
 ** transaction: start
  * executing `deploy:update_code'
    updating the cached checkout on all servers
    executing locally: "git ls-remote git@github.com:andremaha/blog.git master"
    command finished in 4916ms
  * executing "if [ -d /home/deployer/apps/blog/shared/cached-copy ]; then cd /home/deployer/apps/blog/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard 6fb7914a0c09159399ce85f00073692c4cd32a8a && git clean -q -d -x -f; else git clone -q git@github.com:andremaha/blog.git /home/deployer/apps/blog/shared/cached-copy && cd /home/deployer/apps/blog/shared/cached-copy && git checkout -q -b deploy 6fb7914a0c09159399ce85f00073692c4cd32a8a; fi"
    servers: ["50.112.249.58"]
    [50.112.249.58] executing command
    command finished in 12628ms
    copying the cached version to /home/deployer/apps/blog/releases/20120726142915
  * executing "cp -RPp /home/deployer/apps/blog/shared/cached-copy /home/deployer/apps/blog/releases/20120726142915 && (echo 6fb7914a0c09159399ce85f00073692c4cd32a8a > /home/deployer/apps/blog/releases/20120726142915/REVISION)"
    servers: ["50.112.249.58"]
    [50.112.249.58] executing command
    command finished in 706ms
  * executing `deploy:finalize_update'
    triggering before callbacks for `deploy:finalize_update'
  * executing `deploy:assets:symlink'
  * executing "rm -rf /home/deployer/apps/blog/releases/20120726142915/public/assets &&\\\n        mkdir -p /home/deployer/apps/blog/releases/20120726142915/public &&\\\n        mkdir -p /home/deployer/apps/blog/shared/assets &&\\\n        ln -s /home/deployer/apps/blog/shared/assets /home/deployer/apps/blog/releases/20120726142915/public/assets"
    servers: ["50.112.249.58"]
    [50.112.249.58] executing command
    command finished in 693ms
  * executing `bundle:install'
  * executing "cd /home/deployer/apps/blog/releases/20120726142915 && bundle install --gemfile /home/deployer/apps/blog/releases/20120726142915/Gemfile --path /home/deployer/apps/blog/shared/bundle --deployment --quiet --without development test"
    servers: ["50.112.249.58"]
    [50.112.249.58] executing command
 ** [out :: 50.112.249.58] sh: 1:
 ** [out :: 50.112.249.58] bundle: not found
 ** [out :: 50.112.249.58] 
    command finished in 679ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/deployer/apps/blog/releases/20120726142915; true"
    servers: ["50.112.249.58"]
    [50.112.249.58] executing command
    command finished in 683ms
failed: "sh -c 'cd /home/deployer/apps/blog/releases/20120726142915 && bundle install --gemfile /home/deployer/apps/blog/releases/20120726142915/Gemfile --path /home/deployer/apps/blog/shared/bundle --deployment --quiet --without development test'" on 50.112.249.58
Avatar

Great screencast, but I got stuck. Don't know how to set them ENV['TWITTER_KEY'] and ENV['TWITTER_SECRET'] variables. How do I set them? Is there a config file for that?

Would really be glad If anyone could help.

Avatar

Hey Alan,

you just saved my day! Thank your for pointing out the //= require_tree . issue. After I put in at the end of the application.js file everything started working.

Thanks again!