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

Ability to pass compile options, pkg install to Rvm_system_ruby #68

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ You can tell RVM to install one or more Ruby versions with:

You should use the full version number. While the shorthand version may work (e.g. '1.9.2'), the provider will be unable to detect if the correct version is installed.

## Installing Ruby with options / or packages (OR: *building Rubies with a modern OpenSSL*)

RVM has several packages that provide required libraries for OS configurations that might not have up to date components. A good example of this is OpenSSL - Ruby 2.0 (for example) depends on OpenSSL 1.x, but most OSes ship with OpenSSL 0.9.x.

There are two new parameters you can use:

rvm_system_ruby {
'ruby-1.8.7':
ensure => 'present',
pkg => "openssl",
install_opts => "--with-openssl-dir=$rvm_path/usr"
}

This will tell RVM to install the openSSL package, then compile RVM with options that point the build process to the new OpenSSL path.

## Creating Gemsets

Expand Down
8 changes: 7 additions & 1 deletion lib/puppet/provider/rvm_system_ruby/rvm_system_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
commands :rvmcmd => "/usr/local/rvm/bin/rvm"

def create
rvmcmd "install", resource[:name]
if resource[:pkg]
#puts "rvm pkg install #{resource[:pkg]}"
rvmcmd "pkg", "install", resource[:pkg]
end

options = resource[:install_opts]
rvmcmd "install", resource[:name], options
set_default if resource.value(:default_use)
end

Expand Down
9 changes: 9 additions & 0 deletions lib/puppet/type/rvm_system_ruby.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,13 @@
desc "Should this Ruby be the system default for new terminals?"
defaultto false
end

newparam(:install_opts) do
desc "Flags to compile RVM with ie: --with-openssl-dir=..."
defaultto ""
end

newparam(:pkg) do
desc "install package for this system ruby"
end
end