FAQ Database Discussion Community


Capistrano deploy on windows fails with git

ruby-on-rails,git,bash,capistrano
I am trying to deploy on windows machine with git bash. Below is my staging.rb file. set :stage, :staging set :chruby_ruby, '2.2' set :rails_env, :staging #set :branch, '15_inaccurate-line-on-map' set :branch, 'staging' set :ssh_options, { forward_agent: true } set :rvm_roles, [:some] set :rvm_map_bins, [] server 'XX.XX.XX.XX', user: 'deploy', roles: %w(web app...

Why I'm getting “undefined local variable or method `rails_env'”?

ruby-on-rails,solr,capistrano,capistrano3
I'm getting undefined local variable or method 'rails_env'when doing execute "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec rake sunspot:solr:stop" I'm not a big capistrano or rails expert. On deploy.rb I have namespace :solr do desc "start solr" task :start do on roles(:app) do execute "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec rake...

Carrierwave uploaded Images aren't persistent after Capistrano deploy

ruby-on-rails,ruby,image,capistrano,rubber
I've just noticed that after I redeploy my rails app to production with cap deploy:migrations any image that I've uploaded via my admin forms (such as creating a testimonial with an avatar image) that the image links are now broken. The images appear fine as long as I don't redeploy...

bundle install fails because “No such file or directory”

ruby-on-rails,gem,capistrano,bundler
I'M trying to deploy with capistrano to a staging server. This command fails both on deploy and manually: cd .../apps/myapp/releases/20150205154326 && ( RVM_BIN_PATH=/usr/local/rvm/bin/ PATH=/usr/bin/git:$PATH /usr/local/rvm/bin/rvm default do bundle install --path .../apps/myapp/shared/bundle --without development test --deployment --quiet ) error: Git error: command 'git clone --no-checkout --quiet ".../apps/myapp/shared/bundle/ruby/2.1.0/cache/bundler/git/fog- 8836460df0e4c80347618efd3adda34209f0c6f7"...

Rails deployment with Capistrano failing

ruby-on-rails,deployment,capistrano,production
I'm pretty new to RoR and deploying apps like these into production, so I've been doing quite a bit of reading. There's one problem I can't seem to get past however. During my investigation, I came upon a thread on SO that indicates the behavior of Capistrano v3.x changed, which...

uninitialized constant ActiveMerchant::Billing::CreditCard::Validateable (NameError) - in Spree shop

ruby-on-rails,deployment,capistrano,activemerchant
i'm new in rails. Today i tried deploy my shop(SpreeShop) to new production server, but somthing was wrong. I have foolowing problem with some gem: activemerchant (1.34.1). Bellow is my stack trace. uninitialized constant ActiveMerchant::Billing::CreditCard::Validateable (NameError) [email protected][email protected]rd.rb:51:in `<class:CreditCard>' [email protected][email protected]rd.rb:49:in...

Capistrano unable to pull a Stash repository using SSH

git,ssh,capistrano,capistrano3,atlassian-stash
I followed the following procedure: Created an SSH key; Enabled SSH in Atlassian Stash; Added SSH key for the Stash account called Capistrano (already used by Capistrano to successfully connect using username and password to Stash) Tested the SSH connection using the command git clone ssh:[email protected]:7999/project/repository.git and the repository is...

Capistrano: linked file database.yml does not exist on my.server.ipadress

ruby-on-rails,deployment,ssh,capistrano
after i try to deploy my app via capistrano to my server i get this error message: DEBUG [605f198a] Finished in 0.084 seconds with exit status 1 (failed). ERROR linked file /home/deploy/myrailsapp/shared/config/database.yml does not exist on xx.xxx.xx.xxx (Backtrace restricted to imported tasks) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing as [email protected]:...

Deploying Rails App with Capistrano - “ERROR: Repository not found.”

ruby-on-rails,capistrano,capistrano3
I'm having trouble using Capistrano to deploy a Rails app to an EC2 instance. I am developing the new app for my work on my personal laptop. I have two Github accounts (personal and work). I tried to add my personal public key but Github refused because my personal Github...

Gemfile not found when running Cron job with Capistrano 3 and whenever gem

ruby-on-rails,capistrano,bundler,whenever
My cron job works fine on my local machine after running whenever -w, after deploy to my VPS, I get this error, release 20150415044915 doesn't exist. any idea? I looked at my crontab -e, the path also looks fine where 20150502114703 is the correct release: 0 1 * * 1...

Is it possible to forward X11 windows in a Capistrano 3?

ssh,capistrano,capistrano3,x11-forwarding,sshkit
I'm trying to forward an X11 window from a remote server. Usually I can do something like ssh -X [email protected] and then for example run feh image.jpg to see the image.jpg picture on my local machine. Is it possible to get that behaviour in Capistrano 3? I'm installing a software...

Rails 4 doesn't detect application after capistrano deployment

ruby-on-rails,capistrano
I'm currently trying to deploy a Rails 4 app using Capistrano 3. All going smoothly but I've got an issue, yeah ! I can't run any rails commands in my app. Here is my related capistrano plugins : gem 'capistrano-rails' gem 'capistrano-unicorn-nginx' gem 'capistrano-rbenv' gem 'capistrano-secrets-yml' gem 'capistrano-rails-console' So when...

pg gem install fails, cannot find libpq-fe.h header

centos,capistrano,bundler,pg,centos7
Whenever I run bundle install on my VPS (CentOS Linux release 7.0.1406 (Core)) I get an error when installing the pg gem. No pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_config checking for libpq-fe.h... no Can't find the 'libpq-fe.h header *** extconf.rb failed *** Could not create...

Executing WP-CLI via SSH and Capistrano

wordpress,ssh,capistrano
I am fairly new to cap hence I can't figure out one thing. I have wp-cli installed on my server which I can run with wp ie wp --vetsion directly on the server will output WP-CLI 0.19.1 - great. What I am trying to achieve is run the command with...

Capistrano Rails deploy with new migration files

ruby-on-rails,ruby-on-rails-4,deployment,capistrano
I want to deploy from a new branch I have created. On this branch, the db/migrate content has changed, I removed some migration files and regenerated a new one. The problem is, when I cap staging deploy from this branch, it fails when running migrations PG::DuplicateTable: ERROR: relation "partners" already...

Issue with running bundle using Capistrano

ruby-on-rails,ruby-on-rails-4,capistrano,unicorn
I've seen this issue in a few other questions/Github issues, but they haven't been able to shed enough light to lead to the solution. The error: bash: bundle: command not found SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: cd /path-to-my-app/current ; bundle exec unicorn -D -c config/unicorn.rb -E production exit status:...

Capistrano and XSendFile configuration

ruby-on-rails,apache,capistrano,passenger,x-sendfile
I am trying to configure Rails production server with Apache 2.2, Passenger 4.0.59 and XSendFile 0.12. Application is deployed via Capistrano. Deployed application produces (maybe large) PDF to #{Rails.root}/tmp and serves this file using send_file. The problem is that Capistrano uses symlinks to point to currently deployed version of application....

Unable to deploy through capistrano after ubuntu upgrade

ruby-on-rails,ubuntu,ruby-on-rails-4,deployment,capistrano
I recently upgraded my development machine to Ubuntu 15.04 (was 14.04LTS) and ran into a problem when trying to deploy changes to my server. The interesting bit is, that I can ssh into my server without any issues (hence, the key file is setup correct), but when I try to...

ssh_options parsing fails in capistrano3

ssh,capistrano,capistrano3
cap --version Capistrano Version: 3.3.5 (Rake Version: 10.4.2) ssh_options is not recognized by the latest cap ssh_options[:keys] = ["#{ENV['HOME']}/.ssh/dev.pem"], forward_agent: true cap --trace development deploy cap aborted! NameError: undefined local variable or method `ssh_options' for main:Object Forward agent is not recognized by the latest cap ssh_options[:keys] = ["#{ENV['HOME']}/.ssh/dev.pem"], forward_agent: true...

capistrano throwing devise secret_key not set

ruby-on-rails,devise,capistrano,rvm-capistrano
im using capistrano 3.1.4, with capfile require 'capistrano/setup' require 'capistrano/deploy' require 'capistrano/rvm' require 'capistrano/rails' require 'capistrano/rails/assets' require 'capistrano/faster_assets' require 'capistrano/rails/migrations' ive setup my gems to use figaro and devise. when i ssh to the box, and ran (with .bash_profile export RAILS_ENV=production) bundle install # works fine bundle exec rake db:migrate...

running rpush as daemon in production using capistrano

ruby-on-rails,push-notification,capistrano
I have set up my rails app for use with rpush. It works fine locally in development using rpush start. But now I want to deploy it to my EC2 server using capistrano-2.15.5. Part of my deploy.rb: after "deploy:stop", "delayed_job:stop" after "deploy:stop", "rpush:stop" after "deploy:start", "delayed_job:start" after "deploy:start", "rpush:start" after...

Please require this file from within a Capistrano recipe (LoadError)

ruby-on-rails-3,capistrano
I'm using Capistrano 2 with Rails 3 project. Recently I rebuilt my gemset form scratch and now I receive error "Please require this file from within a Capistrano recipe (LoadError)" when I try to run rails server. Detailed error message: /Users/leonidlukin/.rvm/rubies/ruby-1.9.3-p429/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/leonidlukin/Sites/moscowshows/script/rails server -b 0.0.0.0 -p 3000 -e...

capistrano deployment unable to bundle install gem with no internet connection

ruby-on-rails,ruby,ruby-on-rails-3,capistrano
I am deploying my application to a new server which has everything installed. I am using the following capistrano deploy.rb: require "capistrano/ext/multistage" require "bundler/capistrano" set :default_environment, { 'ORACLE_HOME' => "/opt/oraclient/64/11.2.0.2/", 'LD_LIBRARY_PATH' => "$ORACLE_HOME/lib:/usr/local/lib", 'PATH' => "/opt/ruby/bin:$PATH:$ORACLE_HOME/bin" } SECURE_FILES = ['database.yml', 'ldap.yml', 'initializers/secret_token.rb'] set :application, "myapp" set :use_sudo, false set :scm,...

Capistrano deploy to many nodes on the same Cloud Service

ruby-on-rails,azure,capistrano
I have a Cloud Service on Azure comprising of many instances, each of those has the same address eg. mycloudservice.cloudapp.net but exposes the ssh service on a random port so that any instance can be accessed from the outside. The problem is that Capistrano doesn't like this naming, to be...

Capistrano: How to share Capistrano tasks?

ruby-on-rails,deployment,capistrano,capistrano3,rvm-capistrano
I have some shared tasks between my staging and production deploy scripts. What is the best practice of writing shared tasks? Do I need to move them to a separate file under /lib/capistrano/tasks for example? And if so how would I do that? I mean what will be the file...

Capistrano current application path

ruby-on-rails,capistrano
While deploying with Capistrano 3 I need to get the current local application path from a task, does Capistrano provides any static variable containing this information?

capistrano deployment to a server without public IP through a proxy

proxy,capistrano,web-deployment
The server that I need to deploy to is in a private network (without a public IP). I can access the server from outside that network through VPN, but with difficulties, and deployment with capistrano breaks every time. I have access to another computer in that private network that has...

Capistrano Symfony Deploy Failed

php,symfony2,capistrano,composer-php
I use following configuration for my staging server, I configured this before 2 weeks that was working without any problems. Today I executed and boom it crashed with no detailed explanation about fail point. I have no idea what is going on here. Capfile # Load DSL and set up...

cap command not found [Cygwin + Capistrano]

ruby-on-rails,gem,rubygems,cygwin,capistrano
I've installed ruby, rubygems and rails through Cygwin setup. Then I've installed a gem: gem install capistrano --verbose No problem here. But when I try to run cap command, Cygwin tells me:cap: command not found When I execute in ./bin/cap it works: $ ./bin/cap Stage not set, please call something...

Hiredis fails when deploying with capistrano

ruby-on-rails,redis,capistrano,hiredis,redis-rails
When trying to deploy an app with ruby 2.2.0 and rails 4.2.0 with gems redis v3.0.1 and hiredis v0.4.5 task which responsible for interactions with redis server fails with the following error: .....ruby/2.2.0/gems/hiredis-0.4.5/lib/hiredis/ext/hiredis_ext.so: undefined symbol: rb_thread_select cap aborted! Does anyone faced the same issue?...

Get path to capistrano shared path from ruby

ruby,ruby-on-rails-4,capistrano,capistrano3
I know that I can get the location of my rails app with Rails.root: > Rails.root => #<Pathname:/var/www/app-name/releases/20150507181426> I am looking for the function to call to get capistrano's shared folder, which in this case is found here: /var/www/app-name/shared/ I need to be able to get the path from within...

Capistrano and Corkscrew PATH error

ruby-on-rails,git,ssh,capistrano,gitlab
I'm trying to deploy my Rails application with Capistrano but when it comes to "git ls-remote" i get the following error: $ /usr/bin/env git ls-remote --heads [email protected]<server>:<project>.git /bin/bash: line 0: exec: corkscrew: not found DEBUG [a5205e2a] ssh_exchange_identification: Connection closed by remote host DEBUG [a5205e2a] fatal: The remote end hung up...

Nitrous.io: Deploying with capistrano results in “ERROR: Repository not found” despite being able to view remote, push/pull, etc

git,github,deployment,capistrano,nitrousio
I am setting up a Nitrous.io box and can't use capistrano to deploy my code from github to the staging server. The remote is set up and I've added the nitrous public ssh key to the server (I can ssh in from the Nitrous terminal) and to my github account,...