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 Suggestion: Add a rubygems resource. #40

Closed
yfeldblum opened this issue Sep 29, 2011 · 10 comments
Closed

Feature Suggestion: Add a rubygems resource. #40

yfeldblum opened this issue Sep 29, 2011 · 10 comments
Assignees

Comments

@yfeldblum
Copy link

Feature Suggestion: Add a rubygems resource.

And an accompanying rubygems provider.

Motivation:

The user may have installed ruby and its default rubygems some time ago, but may wish to keep current with rubygems or downgrade in case of rubygems issues.

Specification:

The resource should have a required attribute ruby_string to specify which rvm-managed ruby's rubygems to change.

The resource should have an optional attribute version to specify the version constraints on the rubygems for the named ruby. The version attribute should permit an exact version, and it should also permit a version constraint, a comma-separated string of version constraints, or an array of version constraints.

The resource should have a default action of install, but also an action of upgrade.

The install action should install/upgrade rubygems into the named ruby only if a version of rubygems complying with the version constraints from the version attribute is missing.

The upgrade action should always install/upgrade rubygems into the named ruby, unless the most-recent version of rubygems complying with the version constraints from the version attribute is already installed.

@fnichol
Copy link
Contributor

fnichol commented Oct 5, 2011

I've been feeling that need as well based on issues and feedback. Unfortunately, there is still a real need for 1.3.7 when supporting older codebases. Sounds good, it's on the board :)

@ghost ghost assigned fnichol Oct 15, 2011
@alindeman
Copy link

So is there a suggested way to update rubygems with this cookbook for now?

@fnichol
Copy link
Contributor

fnichol commented Nov 26, 2011

@alindeman I've done this in the past which can work (although a bit lower level) in a cookbook recipe:

# assumptions:
#   * this is a system-wide install. For user-based ones use rvm::user_install
#   * the RVM Ruby to be modified is the default ruby

# include system_install which only installs RVM (doesn't install any rubies or gems)
include_recipe "rvm::system_install"

# install the default ruby from attribute metadata
rvm_default_ruby node['rvm']['default_ruby']

# use an rvm_shell to call rvm rubygems before installing any gems
rvm_shell "use rubygems 1.3.7 with default_ruby" do
  ruby_string  node['rvm']['default_ruby']
  code         %{rvm rubygems 1.3.7}
end

# install gems, like:
rvm_gem "nokogiri" do
  ruby_string  node['rvm']['default_ruby']
end

The tricky part is upgrading/downgrading your version of RubyGems after RVM installs and before gems get installed. Hope that helps in the meantime :)

@yfeldblum
Copy link
Author

Thanks for the tip.

It would still be cool to have rvm_rubygems be a separate resource, or for rvm_ruby to take a rubygems_version attribute (and up/down-grade rubygems to the specified version, if the version for rubygems is different).

rvm_ruby "ruby-1.9.3-p0" do
  rubygems_version "1.8.11"
end

@fnichol
Copy link
Contributor

fnichol commented Nov 26, 2011

I agree and probably the best solution is to provide an rvm_rubygems resource that can also be used by rvm_ruby/rubygems_version. I'm hoping to spend some time with this on the weekend.

@tholschuh
Copy link

Any news on this?

@cgriego
Copy link
Contributor

cgriego commented May 7, 2012

I've made a pull request (#100) that is, I think, the first step in addressing this.

@fnichol
Copy link
Contributor

fnichol commented May 14, 2012

@cgriego I'm hoping to get a tagged release out and then tackle this one.

@fnichol
Copy link
Contributor

fnichol commented Jan 15, 2013

Thanks to @cgriego this is (finally) pulled in. Thanks everyone for helping out on this one.

@fnichol fnichol closed this as completed Jan 15, 2013
@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

5 participants