Got error while deploy rails code on server using capistrano - ruby-on-rails

I am getting below error when tried to deploy using capistrano
Error: RVM was unable to use 'ruby-2.0.0-p353'
command finished in 841ms
** [deploy:update_code] exception while rolling back: Capistrano::CommandError, failed: "rvm_path=$HOME/.rvm $HOME/.rvm/bin/rvm-shell 'ruby-2.0.0-p353' -c 'rm -rf /home/demo/demoser/releases/20151019122017; true'" on xx.xxx.xxx.xxx
Any one have a solution.
Thanks

Related

Got error while deploy rails code on server

I am getting below error when tried to deploy using capistrano
/usr/local/rvm/bin/rvm-shell - No such file or directory
** [deploy:update_code] exception while rolling back: Capistrano::CommandError, failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-2.0.0-p353' -c 'rm -rf /home/xxx/xxxxxx/releases/20151019095324; true'" on xx.xx.xxx.xxx
Any one have a solution.
Rvm is probably not installed or not accessible from the user "declared" in capistrano.
Refer to https://rvm.io/rvm/install to check if rvm is correctly installed on your server.

Capistrano Deployment: git-checkout-index: unable to write file, cannot create directory

I am new to deploying rails websites using capistrano.
I pushed my changes to the git repository successfully without getting any error.
Now I need to push the same changes to the production server using Capistrano.
When I run cap deploy I get the following error:
urjit#urjit-Lenovo:~/workspace/dev$ cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote git#github.com:devrepublicrep/devcockpit.git HEAD"
/usr/bin/git
* executing "git clone -q git#github.com:devrepublicrep/devcockpit.git /home/devcockpit/releases/20120820062500 && cd /home/devcockpit/releases/20120820062500 && git checkout -q -b deploy c51262dbb81a66f307127c85add0786552c03cad && (echo c51262dbb81a66f307127c85add0786552c03cad > /home/devcockpit/releases/20120820062500/REVISION)"
servers: ["dev.devrepublic.nl"]
Password:
[dev.devrepublic.nl] executing command
** [dev.devrepublic.nl :: err] error: git-checkout-index: unable to write file public/javascripts/ckeditor/_source/plugins/embed/dialogs/embed.js
** [dev.devrepublic.nl :: err] fatal: cannot create directory at public/javascripts/ckeditor/_source/skins/v2/images
** [dev.devrepublic.nl :: err] fatal: Untracked working tree file '.gitignore' would be overwritten by merge.
command finished
*** [deploy:update_code] rolling back
* executing "rm -rf /home/devcockpit/releases/20120820062500; true"
servers: ["dev.devrepublic.nl"]
[dev.devrepublic.nl] executing command
command finished
failed: "sh -c 'git clone -q git#github.com:devrepublicrep/devcockpit.git /home/devcockpit/releases/20120820062500 && cd /home/devcockpit/releases/20120820062500 && git checkout -q -b deploy c51262dbb81a66f307127c85add0786552c03cad && (echo c51262dbb81a66f307127c85add0786552c03cad > /home/devcockpit/releases/20120820062500/REVISION)'" on dev.devrepublic.nl
Please Help me.
Thanks.
I got the answer need to clean up some space.
so I ran cap deploy:cleanup command.

Why do I get failed: "sh -c 'cd /var/www/releases...'" when deploying a Rails app?

I'm deploying to a Debian 6 server, with Apache, Passenger, Ruby1.9.1
When I run "cap deploy" or "cap deploy:migrations" I get this error:
[out :: ip.address] Could not find multi_json-1.0.3 in any of the sources
** [out :: ip.address] Run `bundle install` to install missing gems.
** [out :: ip.address]
command finished in 1037ms
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/releases/20111208004427; true"
servers: ["ip.address"]
[ip.address] executing command
command finished in 489ms
failed: "sh -c 'cd /var/www/releases/20111208004427 && /usr/bin/rake1.9.1 RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'" on ip.address
Note the run bundle install to install missing gems and failed sh -c ... part.
I already tried this export PATH=/var/lib/gems/1.9.1/bin:${PATH} and tried many other possible solutions but nothing seems to work.
By the way, NO rvm.
Make sure that your config/deploy.rb file is including Bundler's capistrano tasks with this line:
require 'bundler/capistrano'
This will tell it to run bundle install after updating your code, but before it runs other tasks like rake assets:precompile.
For reference for everybody else getting the same error. Found answer: http://www.pastbedti.me/2011/06/change-path-environment-with-rails-and-capistrano/

Could not find rake on capistrano deploy

So I am attempting to get a capistrano deployment setup with an nginx/unicorn server, using RVM.
The deploy works, but when I attempt to interact with unicorn via capistrano i get an error like:
[~/source/quibbler/config]
$ cap unicorn:start
* executing `unicorn:start'
* executing "cd /u/apps/quibbler/current && bundle exec unicorn_rails -c /u/apps/quibbler/current/config/unicorn-production.rb -E production -D"
servers: ["wwwtestvm.whf.app"]
[wwwtestvm.whf.app] executing command
** [out :: wwwtestvm.whf.app] Could not find rake-0.9.2 in any of the sources
command finished in 553ms
failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-1.9.2-p290#quibbler' -c 'cd /u/apps/quibbler/current && bundle exec unicorn_rails -c /u/apps/quibbler/current/config/unicorn-production.rb -E production -D'" on wwwtestvm.whf.app
I have searched the interwebs all night and can not find the solution. If I copy paste the command into my shell it works so I am 99% sure it has to do with the RVM environment not being correct.
I have created a gist of my deploy and unicorn configs:
https://gist.github.com/1375736#file_deploy.rb
https://gist.github.com/1375736#file_unicorn_production.rb
Any help or guidance would be appreciated.
Thanks to sannankhalid answer on this other question i was able to resolve it.
Short answer: add rake to your Gemfile, make sure you run bundle install so your Gemfile.lock gets updated, then deploy to your server, ayay!

Trying to deploy app via Capistrano for first time, having problems

I am trying to deploy a Rails app via Capistrano but am having problems. The messages that get returned in Terminal are as follows:
victor$ cap deploy
* executing `deploy'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
executing locally: "git ls-remote git#github.com:victory/PUM.git HEAD"
/Library/Ruby/Gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy.rb:98: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
/Library/Ruby/Gems/1.8/gems/capistrano-2.5.19/lib/capistrano/recipes/deploy.rb:98: command not found: git ls-remote git#github.com:victory/PUM.git HEAD
*** [deploy:update_code] rolling back
* executing "rm -rf /passenger/nginx/pumpl/releases/20101020025555; true"
servers: ["188.126.236.269"]
Password:
I tried to do a Google search but am having a bit of trouble finding a good answer
Would seem your remote installation lacks git.
Have you tried doing a
cap deploy:check
To check the environment and a
cap deploy:setup
To setup the required files?
I finally figured it out.
I just switched to a new Mac that didn't have Xcode installed. This is why Macports was not working correctly. I installed Xcode and after that, I am now able to deploy just fine.

Resources