Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] ability to not install a system ruby version? #34

Open
thom-nic opened this issue Mar 2, 2015 · 6 comments
Open

[feature request] ability to not install a system ruby version? #34

thom-nic opened this issue Mar 2, 2015 · 6 comments

Comments

@thom-nic
Copy link

thom-nic commented Mar 2, 2015

I want to install rbenv with this role but then not install a ruby version until later in my build when my app sources are checked out. There's a .ruby-version file which defines the proper ruby version (at which point I can just add a shell: bash -lc rbenv install line to install the correct ruby version without specifying it anywhere in my ansible vars. Does that make sense? Could it be possible to define rbenv.ruby_version as an empty/ false value to skip the default install?

@zzet
Copy link
Owner

zzet commented Mar 2, 2015

@thom-nic can you show content of your .ruby-version file?

@thom-nic
Copy link
Author

thom-nic commented Mar 2, 2015

It's just a single line:

2.1.3

Rbenv already understands how to process it, it's sort of a generic .rbenv-version file. I just go to the root directory of your project and do rbenv install. rbenv also knows which ruby version to activate when running project executables (ruby, rake) by looking at the same file.

@zzet
Copy link
Owner

zzet commented Mar 2, 2015

@thom-nic do you need to override ruby version from default 2.2.0 to your 2.1.3?

@zzet
Copy link
Owner

zzet commented Mar 2, 2015

As can you see in Readme - you can setup any ruby with this role.

- hosts: all
  vars:
    rbenv:
      env: user
      version: v0.4.0
      ruby_version: 2.0.0-p353
  roles:
    - role: zzet.rbenv
      rbenv_users:
        - user

as example

@thom-nic
Copy link
Author

thom-nic commented Mar 2, 2015

Yeah I understand I can set it up that way but I still have to specify the ruby version there in addition to what's in my project .ruby-version. rbenv's ruby shim will throw an error if what's in .ruby-version is different from what's defined in the ansible vars. Trying to keep it DRY and reduce the chance for errors.

Simply not installing a system ruby until the app is installed would fix that. I mean I can run rbenv install regardless after my app is installed and to ensure the proper ruby version is installed for my app but it will increase the build/ deploy time if two different rubies get installed.

@iangreenleaf
Copy link

👍 it would be great to have an option to skip installing a Ruby and just set up rbenv instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants