Open BRZInc opened 10 years ago
is rvm installed on the server? the capistrano-rvm
gem assumes that you do all the server setup separately from your deploy, this includes rvm and ruby installation. In case when you prefer to do it during deploy you should try rvm1-capistrano3 instead of capistrano-rvm
... I have even a PR for merging the two => https://github.com/capistrano/rvm/pull/34
@mpapis, yes, both rvm and ruby have been installed earlier:
mustela@Mustela-Prod:~$ rvm --version
rvm 1.25.22 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
mustela@Mustela-Prod:~$ ruby --version
ruby 2.1.1p76 (2014-02-24 revision 45161) [i686-linux]
I've actually followed the following instruction in my deploy: http://guides.spreecommerce.com/developer/manual-ubuntu.html
BTW, if I set set :rvm_type, :system
in my deploy.rb file, I get the following error instead:
rustems-mbp:mustela rbedretdinov$ cap production rvm:check
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/bundler-1.6.1/lib/bundler.rb:301: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
DEBUG [01d3f1c6] Running /usr/local/rvm/bin/rvm version on 188.226.217.83
DEBUG [01d3f1c6] Command: /usr/local/rvm/bin/rvm version
DEBUG [01d3f1c6]
DEBUG [01d3f1c6] rvm 1.25.22 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
DEBUG [01d3f1c6]
DEBUG [01d3f1c6] Finished in 1.744 seconds with exit status 0 (successful).
rvm 1.25.22 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
DEBUG [1cc0c38c] Running /usr/local/rvm/bin/rvm current on 188.226.217.83
DEBUG [1cc0c38c] Command: /usr/local/rvm/bin/rvm current
DEBUG [1cc0c38c] ruby-2.1.1
DEBUG [1cc0c38c] Finished in 0.792 seconds with exit status 0 (successful).
ruby-2.1.1
DEBUG [75d8bbbd] Running /usr/local/rvm/bin/rvm default do bundle exec ruby --version on 188.226.217.83
DEBUG [75d8bbbd] Command: /usr/local/rvm/bin/rvm default do bundle exec ruby --version
DEBUG [75d8bbbd] Could not locate Gemfile
cap aborted!
ruby stdout: Nothing written
ruby stderr: Nothing written
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.2.0/lib/sshkit/command.rb:94:in `exit_status='
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:138:in `block (4 levels) in _execute'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:551:in `call'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:551:in `do_request'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:561:in `channel_request'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:205:in `process'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:269:in `wait'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:160:in `block (2 levels) in _execute'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:514:in `call'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:205:in `process'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.7.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:162:in `block in _execute'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:119:in `tap'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:119:in `_execute'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:76:in `capture'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/bundler/gems/rvm-dc35ec5e7a74/lib/capistrano/tasks/rvm.rake:10:in `block (3 levels) in <top (required)>'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.2.0/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.2.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => rvm:check
(See full trace by running task with --trace)
I don't understand why does it calls bundle exec ruby --version
instead of ruby --version
the instructions are for Capistrano v2 and you use v3 ... as for the last problem - you should really try rvm1-capistrano3
- it does not have this problems and you get instant support from me in case of problems
@mpapis Thanks a lot for advice! Previous issue is resolved, but I'm facing with another one:
Could not determine which Ruby to use; . should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile. ( see: 'rvm usage' )
Full log is found below:
Rustems-MacBook-Pro:mustela rbedretdinov$ cap production rvm1:install:ruby
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/bundler-1.6.1/lib/bundler.rb:301: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
INFO [516bf729] Running /usr/bin/env mkdir -p /tmp/mustela/ on 188.226.217.83
DEBUG [516bf729] Command: /usr/bin/env mkdir -p /tmp/mustela/
INFO [516bf729] Finished in 2.060 seconds with exit status 0 (successful).
DEBUG Uploading /Users/rbedretdinov/.rvm/gems/ruby-2.1.1/bundler/gems/rvm1-capistrano3-5b976ca2684a/script/rvm-auto.sh 0.0%
INFO Uploading /Users/rbedretdinov/.rvm/gems/ruby-2.1.1/bundler/gems/rvm1-capistrano3-5b976ca2684a/script/rvm-auto.sh 100.0%
INFO [5f673911] Running /usr/bin/env chmod +x /tmp/mustela/rvm-auto.sh on 188.226.217.83
DEBUG [5f673911] Command: /usr/bin/env chmod +x /tmp/mustela/rvm-auto.sh
INFO [5f673911] Finished in 0.319 seconds with exit status 0 (successful).
INFO [3c51f84f] Running /usr/bin/env mkdir -p /tmp/mustela/ on 188.226.217.83
DEBUG [3c51f84f] Command: /usr/bin/env mkdir -p /tmp/mustela/
INFO [3c51f84f] Finished in 0.309 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/mustela/git-ssh.sh 0.0%
INFO Uploading /tmp/mustela/git-ssh.sh 100.0%
INFO [f246e00a] Running /usr/bin/env chmod +x /tmp/mustela/git-ssh.sh on 188.226.217.83
DEBUG [f246e00a] Command: /usr/bin/env chmod +x /tmp/mustela/git-ssh.sh
INFO [f246e00a] Finished in 0.280 seconds with exit status 0 (successful).
DEBUG [89e3d1cd] Running /usr/bin/env [ -f /home/mustela/mustela/repo/HEAD ] on 188.226.217.83
DEBUG [89e3d1cd] Command: [ -f /home/mustela/mustela/repo/HEAD ]
DEBUG [89e3d1cd] Finished in 0.289 seconds with exit status 0 (successful).
INFO The repository mirror is at /home/mustela/mustela/repo
DEBUG [304e5bdf] Running /usr/bin/env if test ! -d /home/mustela/mustela/repo; then echo "Directory does not exist '/home/mustela/mustela/repo'" 1>&2; false; fi on 188.226.217.83
DEBUG [304e5bdf] Command: if test ! -d /home/mustela/mustela/repo; then echo "Directory does not exist '/home/mustela/mustela/repo'" 1>&2; false; fi
DEBUG [304e5bdf] Finished in 0.289 seconds with exit status 0 (successful).
DEBUG [b2bab309] Running /usr/bin/env cd /home/mustela/mustela/repo && git rev-parse --short HEAD on 188.226.217.83
DEBUG [b2bab309] Command: cd /home/mustela/mustela/repo && git rev-parse --short HEAD
DEBUG [b2bab309] 2b51ec5
DEBUG [b2bab309] Finished in 0.330 seconds with exit status 0 (successful).
INFO [145ac78a] Running /usr/bin/env git remote update on 188.226.217.83
DEBUG [145ac78a] Command: cd /home/mustela/mustela/repo && /usr/bin/env git remote update
DEBUG [145ac78a] Fetching origin
INFO [145ac78a] Finished in 1.373 seconds with exit status 0 (successful).
DEBUG [f7356262] Running /usr/bin/env cd /home/mustela/mustela/repo && git rev-parse --short HEAD on 188.226.217.83
DEBUG [f7356262] Command: cd /home/mustela/mustela/repo && git rev-parse --short HEAD
DEBUG [f7356262] 2b51ec5
DEBUG [f7356262] Finished in 0.264 seconds with exit status 0 (successful).
DEBUG [2ef59d20] Running /usr/bin/env if test ! -d /home/mustela/mustela/repo; then echo "Directory does not exist '/home/mustela/mustela/repo'" 1>&2; false; fi on 188.226.217.83
DEBUG [2ef59d20] Command: if test ! -d /home/mustela/mustela/repo; then echo "Directory does not exist '/home/mustela/mustela/repo'" 1>&2; false; fi
DEBUG [2ef59d20] Finished in 0.290 seconds with exit status 0 (successful).
INFO [4c32022e] Running /usr/bin/env mkdir -p /home/mustela/mustela/releases/20140414063107 on 188.226.217.83
DEBUG [4c32022e] Command: cd /home/mustela/mustela/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/mustela/git-ssh.sh /usr/bin/env mkdir -p /home/mustela/mustela/releases/20140414063107 )
INFO [4c32022e] Finished in 0.289 seconds with exit status 0 (successful).
INFO [70b993b5] Running /usr/bin/env git archive mustela | tar -x -C /home/mustela/mustela/releases/20140414063107 on 188.226.217.83
DEBUG [70b993b5] Command: cd /home/mustela/mustela/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/mustela/git-ssh.sh /usr/bin/env git archive mustela | tar -x -C /home/mustela/mustela/releases/20140414063107 )
INFO [70b993b5] Finished in 0.428 seconds with exit status 0 (successful).
DEBUG [b7dcc2c4] Running /usr/bin/env if test ! -d /home/mustela/mustela/releases/20140414063107; then echo "Directory does not exist '/home/mustela/mustela/releases/20140414063107'" 1>&2; false; fi on 188.226.217.83
DEBUG [b7dcc2c4] Command: if test ! -d /home/mustela/mustela/releases/20140414063107; then echo "Directory does not exist '/home/mustela/mustela/releases/20140414063107'" 1>&2; false; fi
DEBUG [b7dcc2c4] Finished in 0.290 seconds with exit status 0 (successful).
INFO [f4c31b0d] Running /usr/bin/env /tmp/mustela/rvm-auto.sh rvm install . on 188.226.217.83
DEBUG [f4c31b0d] Command: cd /home/mustela/mustela/releases/20140414063107 && /usr/bin/env /tmp/mustela/rvm-auto.sh rvm install .
DEBUG [f4c31b0d] Could not determine which Ruby to use; . should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile. ( see: 'rvm usage' )
cap aborted!
SSHKit::Command::Failed: /tmp/mustela/rvm-auto.sh stdout: Nothing written
/tmp/mustela/rvm-auto.sh stderr: Nothing written
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/command.rb:94:in `exit_status='
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:142:in `block (4 levels) in _execute'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:551:in `call'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:551:in `do_request'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:561:in `channel_request'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:205:in `process'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:269:in `wait'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:164:in `block (2 levels) in _execute'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:514:in `call'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:514:in `do_open_confirmation'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:545:in `channel_open_confirmation'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:205:in `process'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `block in loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:169:in `loop'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:166:in `block in _execute'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `tap'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:123:in `_execute'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:66:in `execute'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/bundler/gems/rvm1-capistrano3-5b976ca2684a/lib/rvm1/tasks/capistrano3/install.rake:18:in `block (5 levels) in <top (required)>'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/backends/abstract.rb:81:in `within'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/bundler/gems/rvm1-capistrano3-5b976ca2684a/lib/rvm1/tasks/capistrano3/install.rake:17:in `block (4 levels) in <top (required)>'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/rbedretdinov/.rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => rvm1:install:ruby
(See full trace by running task with --trace)
as the message in the middle says:
Could not determine which Ruby to use; . should contain .rvmrc or .versions.conf or .ruby-version or .rbfu-version or .rbenv-version, or an appropriate line in Gemfile. ( see: 'rvm usage' )
do you have a project file that specifies ruby version to use?
@mpapis thanks a lot for the hint!
Finally I've simply added my ruby version as '2.1.1' into .ruby-version file in the application catalogue. That has helped me to eliminate from the exception.
as all works now the issue can be closed now?
Yes, lets close to for now.
Best Regards, Rustem Bedretdinov. http://about.me/bedretdinovr
On Apr 15, 2014, at 9:19 AM, Michal Papis notifications@github.com wrote:
as all works now the issue can be closed now?
— Reply to this email directly or view it on GitHub.
@mpapis
Many thanks! rvm1-capistrano3
solved my problem
Hello,
Could you please help me with the following issue?
Currently I'm deploying my solution to a new service. However I'm stuck with my deployment - whenever I execute:
I get the following error:
Here is my Gemfile contents:
I've already tried to latest capistrano-rvm, capistrano-bundler, capistrano-rails gems versions.
Please help!