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

Let gem_package recognize multiple environments #24

Closed
temujin9 opened this issue Jun 15, 2011 · 6 comments
Closed

Let gem_package recognize multiple environments #24

temujin9 opened this issue Jun 15, 2011 · 6 comments

Comments

@temujin9
Copy link
Contributor

Setting @node[:rvm][:gem_package][:rvm_string] = 'system,ruby-1.9.2' will allow gem_package to install to two environments simultaneously. However, it breaks the detection of environments that allows this to be idempotent.

[Wed, 15 Jun 2011 00:00:46 +0000] INFO: Installing gem_package[rack-throttle] version 0.3.0
[Wed, 15 Jun 2011 00:00:46 +0000] WARN: rvm_environment[system,ruby-1.9.2] is either not fully qualified or not known . Use rvm list known to get a full list.

@fnichol
Copy link
Contributor

fnichol commented Jun 15, 2011

I hadn't considered putting in multiple rubies as a value for :rvm_string. In this case, the rvm_enviroment resource is bailing since it can't make sense of 'system,ruby-1.9.2 as a single valid ruby. So I guess we could go 2 ways:

  • support a comma-delimited string that the rvm_environment LWRP could understand
  • support a string or array value for rvm/gem_package/rvm_string and add array support on rvm_environment.

What do you think is most natural?

Other than the multiple rubies issue, have you had luck with this resource (gem_package)? It was something of a late night experiment and I'm hoping it has potential.

@temujin9
Copy link
Contributor Author

Array is probably more natural, but I'd be happy with either. I don't think a comma is a valid character for a rvm environment name, so using it as a delimiter should be fine.

@temujin9
Copy link
Contributor Author

I noticed another issue I'm trying to fix now; gem_package is patched at compile time, but rvm::install isn't done until execute time. If any other package installs a gem at compile time, chef bombs out. I'm patching rvm::install to do its stuff at compile time, to see if that fixes the problem.

Other than that issue, it seems to be working as advertised (and beyond, as described above). Its nice work, and just what I needed for this project (which has umpteen gem_package invocations in many recipes, some we don't care to patch).

@yfeldblum
Copy link

Arrays of strings are easy in Ruby - use them!

node.rvm.gem_package.rvm_string = %w(system ruby-1.9.2)

@fnichol
Copy link
Contributor

fnichol commented Jun 18, 2011

Agreed then, arrays are a pretty natural expectation.

@temujin9 That's exactly the use case I was going for: supporting rvm with unmodified cookbooks. Thanks for the feedback!

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants