Install Bundler gem using Ansible

前端 未结 6 481
忘了有多久
忘了有多久 2020-12-14 00:46

I am trying to install Bundler on my VPS using Ansible.

I already have rbenv set up and the global ruby is 2.1.0.

If I SSH as root into the server and run

6条回答
  •  伪装坚强ぢ
    2020-12-14 01:12

    The cleanest and quickest way to install bundler using Ansible is this:

    Simply install rbenv by using the role https://github.com/zzet/ansible-rbenv-role and by configuring its plugins like so (obviously, there are more parameters to configure than just the plugins):

    rbenv_plugins:
    - { name: 'ruby-build',
        repo: 'https://github.com/rbenv/ruby-build.git',
        version: master }
    - { name: 'rbenv-default-gems',
        repo: 'https://github.com/rbenv/rbenv-default-gems.git',
        version: master }
    

    The included plugin rbenv-default-gems will add bundler by default and into the right directory during the installation process of the version of ruby you will have spcecified.

    Then make sure bundler is in PATH.

    That's it.

提交回复
热议问题