How to install RVM system requirements without giving sudo access for RVM user

后端 未结 4 1662
面向向阳花
面向向阳花 2020-12-07 08:45

On my Debian server I have a user called \"deployer\" that does not have sudo access, and has RVM installed.

When installing Ruby using \"deployer\", li

相关标签:
4条回答
  • 2020-12-07 09:30

    I prefer this

    $ rvm autolibs fail
    $ rvm install ruby
    Searching for binary rubies, this might take some time.
    Found remote file https://rubies.travis-ci.org/ubuntu/12.04/x86_64/ruby-2.1.1.tar.bz2
    Checking requirements for ubuntu.
    Missing required packages: gawk g++ gcc make libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev
    RVM autolibs is now configured with mode '2' => 'check and stop if missing',
    please run `rvm autolibs enable` to let RVM do its job or run and read `rvm autolibs [help]`
    or visit https://rvm.io/rvm/autolibs for more information.
    Requirements installation failed with status: 1.
    

    then I can relogin with root and run

    # apt-get install gawk g++ gcc make libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev
    
    0 讨论(0)
  • 2020-12-07 09:32

    The problem was introduced somewhere in the latest RVM versions. Don't know exactly when, but definitely in the past 3-4 months.

    Try this:

    rvm get 1.18.8
    rvm install <whichever-version-you-want>
    

    I don't know exactly when on the path between 1.18.8 and 1.20.12 that problem got introduced, but for me the installation works with RVM v1.18.8 and fails with v1.20.12.

    0 讨论(0)
  • 2020-12-07 09:46

    The accepted answer fails to install Ruby into .rvm/bin/ruby. The shell script ends up in .rvm/wrappers/ruby-2.0.0-p247/ruby which is a pain if your build script depends on this location and the version number changes over time.

    Here is an easier solution that worked for me:

    \curl -L https://get.rvm.io | bash -s -- --ignore-dotfiles --autolibs=0 --ruby
    

    .rvm/bin/ruby is created as expected.

    Source: http://blog.sunild.com/2013/07/install-ruby-with-rvm-on-mac-os-108.html

    0 讨论(0)
  • 2020-12-07 09:49

    This is indeed a new feature of RVM called autolibs, which automatically installs dependencies.

    If you have already installed RVM, and it is asking you for your sudo password, you can disable autolibs:

    $ rvm autolibs disable
    $ rvm requirements # manually install these
    $ rvm install ruby
    

    Otherwise, you can install RVM without autolibs with this command:

    $ \curl -L https://get.rvm.io | bash -s -- --autolibs=read-fail
    

    I understand the motivation, but find it rather annoying. I do not want to put my sudo password into RVM, nor for that matter Bundle! Please community, stop doing this.

    0 讨论(0)
提交回复
热议问题