Puppet not upgrading to newer version of Ruby

36 views
Skip to first unread message

Benjamin Lei

unread,
Jul 6, 2012, 11:01:53 AM7/6/12
to puppet...@googlegroups.com
I have upgraded my default Ruby (1.8.6) to a newer one (1.8.7). But whenever I run Puppet, it seems to somehow constantly run under Ruby 1.8.6. How do I fix this?

Peter Bukowinski

unread,
Jul 6, 2012, 12:27:52 PM7/6/12
to puppet...@googlegroups.com
On Jul 6, 2012, at 11:01 AM, Benjamin Lei wrote:

I have upgraded my default Ruby (1.8.6) to a newer one (1.8.7). But whenever I run Puppet, it seems to somehow constantly run under Ruby 1.8.6. How do I fix this?

What is the output of 'which ruby' and 'which puppet'?

--
Peter Bukowinski

Benjamin Lei

unread,
Jul 6, 2012, 9:32:29 PM7/6/12
to puppet...@googlegroups.com
By me:
/usr/local/bin/ruby
/usr/bin/puppet

By puppet:
/usr/bin/ruby
/usr/bin/puppet

Huh that's weird :/ How do I make it so that ruby installs under /usr/bin then?

Here's what I currently do:
exec { "unload-ruby":
command => "wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p370.tar.gz >> /tmp/ruby.log && tar -zxf ruby-1.8.7-p370.tar.gz >> /tmp/ruby.log",
cwd => "/tmp",
path => "/bin:/usr/bin",
#require => Package["ruby"],
onlyif => "ruby -v | grep 1.8.6",
}

exec { "config-ruby":
command => "/tmp/ruby-1.8.7-p370/configure --enable-pthread >> /tmp/ruby.log",
cwd => "/tmp/ruby-1.8.7-p370",
path => "/bin:/usr/bin",
require => Exec["unload-ruby"],
onlyif => "ruby -v | grep 1.8.6",
}

exec { "make-ruby":
command => "make >> /tmp/ruby.log && make install >> /tmp/ruby.log",
cwd => "/tmp/ruby-1.8.7-p370",
path => "/bin:/usr/bin",
require => Exec["config-ruby"],
onlyif => "ruby -v | grep 1.8.6",
}

I'm guessing I need some option in one of these?

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To post to this group, send email to puppet...@googlegroups.com.
To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.

Felix Frank

unread,
Jul 10, 2012, 5:49:33 AM7/10/12
to puppet...@googlegroups.com
Yes, usually --prefix.

But if you *must* install ruby from source, you probably want to make
sure you're not overwriting files owned by the original ruby packages.
Installing to /usr/local is usually the cleaner approach.

You may want to make puppet use the correct search path instead.

HTH,
Felix

Benjamin Lei

unread,
Jul 10, 2012, 10:54:05 AM7/10/12
to puppet...@googlegroups.com
I've tried --prefix but it didn't update (and at that point, it was overwriting it). The original Ruby install was is /usr/bin.

Reply all
Reply to author
Forward
0 new messages