Git Product home page Git Product logo

Comments (25)

JeanMertz avatar JeanMertz commented on May 13, 2024

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.

JeanMertz avatar JeanMertz commented on May 13, 2024

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.

leehambley avatar leehambley commented on May 13, 2024

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.

DougPuchalski avatar DougPuchalski commented on May 13, 2024

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.

leehambley avatar leehambley commented on May 13, 2024

@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.

vjm avatar vjm commented on May 13, 2024

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.

vjm avatar vjm commented on May 13, 2024

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.

leehambley avatar leehambley commented on May 13, 2024

Did anyone file this upstream with RVM? I don't have the problem with rvm
head.

from capistrano.

RicSwirrl avatar RicSwirrl commented on May 13, 2024

I have this problem, I installed rvm today with

$ bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)

from capistrano.

leehambley avatar leehambley commented on May 13, 2024

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.

niklas avatar niklas commented on May 13, 2024

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.

leehambley avatar leehambley commented on May 13, 2024

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.

vinioliveira avatar vinioliveira commented on May 13, 2024

@niklas nice tip worked out for me too!

from capistrano.

PeterBloom avatar PeterBloom commented on May 13, 2024

Thank @niklas! Worked for me.

from capistrano.

jalvarezsamayoa avatar jalvarezsamayoa commented on May 13, 2024

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.

dougjohnston avatar dougjohnston commented on May 13, 2024

Yep, this totally worked. Thanks!

from capistrano.

moxie avatar moxie commented on May 13, 2024

Thank you @niklas... worked like a charm!

from capistrano.

warpc avatar warpc commented on May 13, 2024

@jalvarezsamayoa, thanks!

from capistrano.

wielinde avatar wielinde commented on May 13, 2024

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.

epipheus avatar epipheus commented on May 13, 2024

rvm installs in /usr/local/rvm/bin for me... got same error as original issue

from capistrano.

leehambley avatar leehambley commented on May 13, 2024

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.

dgm avatar dgm commented on May 13, 2024

Wow, leehambley called it back in June, and no one reported it to them? Come on people!

Reported to RVM:

rvm/rvm#436

from capistrano.

leehambley avatar leehambley commented on May 13, 2024

@dgm thanks for taking the time to report that upstream. (I wasn't doing it on principle)

from capistrano.

xpepermint avatar xpepermint commented on May 13, 2024

Ubuntu: 11+

set :rvm_bin_path, "/usr/share/ruby-rvm/bin"

from capistrano.

bluebird-communication avatar bluebird-communication commented on May 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.