Comments (25)
I just completely reinstalled rvm as a user again, without any errors, and the rvm-shell
command is still not in ~/.rvm/bin/rvm-shell
. Can capistrano only work if I install rvm as root?
from capistrano.
I found out rvm installed the rvm-shell command (and some others) in ~/bin instead of ~/.rvm/bin. So I'm closing this for now, as I assume it's actually a problem with rvm or my installation steps.
from capistrano.
The other errors however, are a mystery to me. when I ssh into my server I
can easily use the rvm
command and it says it's installed as a function.
Furthermore, both git -v
and gem -v
are working correctly. So why
can't capistrano use these commands?
Capistrano prefers non-login shells, that means your dotfiles won't be
processed. RVM > 1.5 should take care of this (but requires an implope
&
reinstall on the server).
You can also request that cap use bash -l
as your shell (runs login files)
- and/or ask for a :pty via the ssh_options hash (not recommended) - which
under some circumstances will process log files.
It's also dependent on your kernel configuration, but your /etc/environment
file may be a smart place to put things like RVM setup, these are processed
at login time by any SSH connection, via a PAM module. /etc/profile, for
example is most often not processed by login shells.
I hope this gives you some food for thought and/or googling, it doesn't take
much with RVM to make problems, a recent install, and staying away from
"system wide" is often smart though.
- Lee
from capistrano.
Why is this closed? I have freshly installed 1.6.20 today and this is a new issue for me. As JeanMertz indicated, rvm-shell is being installed in ~$HOME/bin and not ~$HOME/.rvm/bin. Clearly out of sync with capistrano.rb.
from capistrano.
@doug316 because incorrectly installing/configuring RVM, and their Capistrano extension, which they maintain not working isn't a Capistrano bug. I refer you to their Github repository where the capistrano.rb
file lives
from capistrano.
Has anyone found a solution to this? Still erroring out with:
/home/vmontalb/.rvm/bin/rvm-shell: No such file or directory
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.2-p180'
I can clearly see that the files are in ~/bin instead of ~/.rvm/bin
from capistrano.
I was able to get around the issue for now by symlinking the files into that directory:
ln ~/bin/rvm-shell ~/.rvm/bin/rvm-shell && ln ~/bin/rvm ~/.rvm/bin/rvm && ln ~/bin/rvm-auto-ruby ~/.rvm/bin/rvm-auto-ruby && ln ~/bin/rvm-exec ~/.rvm/bin/rvm-exec && ln ~/bin/rvm-installer ~/.rvm/bin/rvm-installer && ln ~/bin/rvm-prompt ~/.rvm/bin/rvm-prompt && ln ~/bin/rvmsudo ~/.rvm/bin/rvmsudo
from capistrano.
Did anyone file this upstream with RVM? I don't have the problem with rvm
head.
from capistrano.
I have this problem, I installed rvm today with
$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
from capistrano.
I'll say it again, but the Capistrano integration with RMV comes from the
RVM team, if there's a problem, someone needs to take responsibility for
taking this upstream. I can't replicate the problem, so I can't.
- Lee
from capistrano.
as long this is not fixed by upstream rvm you can set the bin path in you deploy.rb
set :rvm_bin_path, "$HOME/bin"
from capistrano.
As long this is not fixed by upstream rvm you can set the bin path in you deploy.rb
Thanks for the tip @niklas, another RVM option, I guess they should change the default!
from capistrano.
@niklas nice tip worked out for me too!
from capistrano.
Thank @niklas! Worked for me.
from capistrano.
This worked for me:
require 'bundler/capistrano'
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require 'rvm/capistrano'
set :rvm_ruby_string, '1.9.2'
set :rvm_bin_path, "/usr/local/bin"
from capistrano.
Yep, this totally worked. Thanks!
from capistrano.
Thank you @niklas... worked like a charm!
from capistrano.
@jalvarezsamayoa, thanks!
from capistrano.
Thank you guys for the hints above.
My rvm-shell is in /usr/local/rvm/bin
, so the following worked for me:
require 'bundler/capistrano'
$:.unshift(File.expand_path('./lib', ENV['rvm_path'])) # Add RVM's lib directory to the load path.
require "rvm/capistrano" # Load RVM's capistrano plugin.
set :rvm_ruby_string, 'ruby-1.9.2@myapp' # Or whatever env you want it to run in.
set :rvm_bin_path, "/usr/local/rvm/bin"
from capistrano.
rvm installs in /usr/local/rvm/bin for me... got same error as original issue
from capistrano.
OK, please no more "me too" - this is RVMs problem, when their Capistrano integration doesn't work with their defaults, it's not our issue. Also, I'm far from convinced that a user-space environment management tool belongs in a hosted server environment.
from capistrano.
Wow, leehambley called it back in June, and no one reported it to them? Come on people!
Reported to RVM:
from capistrano.
@dgm thanks for taking the time to report that upstream. (I wasn't doing it on principle)
from capistrano.
Ubuntu: 11+
set :rvm_bin_path, "/usr/share/ruby-rvm/bin"
from capistrano.
Having same issue and trying to understand where this :rvm_bin_path is documented (why always variables are so badly documented in every project ? even Capistrano variables are note completly documented. Don't misunderstand me; I'm very happy with Capistrano :) ),
I found in the code (https://github.com/wayneeseguin/rvm-capistrano/blob/master/lib/rvm/capistrano.rb) the following procedure :
# Define rvm_path
# This is used in the default_shell command to pass the required variable to rvm-shell, allowing
# rvm to boostrap using the proper path. This is being lost in Capistrano due to the lack of a
# full environment.
_cset(:rvm_path) do
case rvm_type
when :root, :system
"/usr/local/rvm"
when :local, :user, :default
"$HOME/.rvm/"
else
rvm_type.to_s.empty? ? "$HOME/.rvm" : rvm_type.to_s
end
end
# Let users override the rvm_bin_path
_cset(:rvm_bin_path) do
case rvm_type
when :root, :system
"/usr/local/rvm/bin"
when :local, :user, :default
"$HOME/.rvm/bin"
else
rvm_type.to_s.empty? ? "#{rvm_path}/bin" : rvm_type.to_s
end
end
So it looks like rvm developers are aware of the case, and the :rvm_type variable exist to solve this case.
If fact it depend if you installed rvm as user or with "sudo", or as a root.
Following instruction on https://rvm.io/integration/capistrano/ :
Please note that this defaults to using a user installation of rvm. If you wish to instead set it to use an system wide (root) install, add the following to your Capfile deploy.rb :
set :rvm_type, :system # Copy the exact line. I really mean :system here*
So those having rvm bin stored in /usr/local/rvm/bin, should set :rvm_type with :system
from capistrano.
Related Issues (20)
- Ed25519 Algorithm Compatibility HOT 9
- Ruby 3.1: Can't run rubocop on capistrano repo HOT 1
- Can't continue deploying after for while via capistrano HOT 1
- Authentication failed for user HOT 1
- When I was running this "" command it showing error I don't understand why this error showing I was try to deploy with Jenkins pipeline, and I also add my public key deployment server still this error show (-t for tag)
- When I was running this "bundle exec cap demo deploy -t latest" command it showing error, I was try to deploy with Jenkins pipeline and my public ssh key add deploy server ERROR: SSHKit::Runner::ExecuteError: HOT 1
- Git CVE-2022-24765 and `safe.directory` Exceptions with Multiple Users HOT 6
- Documentation references the deprecated :scm variable HOT 2
- rsync instead of scp? HOT 2
- Default scm branch to "main" HOT 1
- If there is no way deploy with capistrano? [GitHub action] HOT 2
- Connection stale when running a command that takes ~4 hours to finish HOT 1
- Capistrano deletes last working deployment if recovering from too many failures HOT 1
- Deployment fail on precompile -> compilation step. Possible memory leak? HOT 3
- Deploying a new app to a staging server won't start/restart puma/systemd HOT 1
- Switch from CircleCI to GitHub Actions
- Danger CI job doesn't run on PRs from forks
- Security issue reported to [email protected]
- Docs bug HOT 2
- Deployment fails with Ruby 3.3.0-rc1 HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from capistrano.