Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

Install from source fails #2

Open
spuder opened this issue Sep 24, 2013 · 3 comments
Open

Install from source fails #2

spuder opened this issue Sep 24, 2013 · 3 comments

Comments

@spuder
Copy link
Contributor

spuder commented Sep 24, 2013

Problem: Attempting to install ruby version from source results in the same ruby version before the module was run.

cat /vagrant/tests/ruby.pp
class { 'ruby':
  version             => '1.9.3-p392',
  compile_from_source => true,
}

Notice that 1.8.7 is the version before and after the puppet run.

root@ubuntu-server-12042-x64-vbox4210-nocm:~# ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

root@ubuntu-server-12042-x64-vbox4210-nocm:~# puppet apply /vagrant/tests/ruby.pp 
Warning: Could not retrieve fact fqdn
Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults
Notice: Compiled catalog for ubuntu-server-12042-x64-vbox4210-nocm in environment production in 0.48 seconds
Notice: /Stage[main]/Ruby::Compile/Puppi::Install_packages[ruby_compile_prerequisites]/File[/root/puppi_install_packages]/ensure: created
Notice: /Stage[main]/Ruby::Compile/Puppi::Install_packages[ruby_compile_prerequisites]/File[install_packages_ruby_compile_prerequisites]/ensure: created
Notice: /Stage[main]/Ruby::Compile/Puppi::Install_packages[ruby_compile_prerequisites]/Exec[install_packages_ruby_compile_prerequisites]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Ruby::Compile/Puppi::Netinstall[ruby_source]/Exec[Retrieve http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.zip in /var/tmp]/returns: executed successfully
Notice: /Stage[main]/Ruby::Compile/Puppi::Netinstall[ruby_source]/Exec[Extract ruby-1.9.3-p392.zip from /var/tmp]/returns: executed successfully
Notice: /Stage[main]/Ruby::Compile/Puppi::Netinstall[ruby_source]/Exec[PostExtract ruby-1.9.3-p392.zip in /var/tmp]: Triggered 'refresh' from 1 events
Notice: /Stage[main]/Ruby::Compile/Puppi::Netinstall[ruby_source]/Exec[Chown ruby-1.9.3-p392.zip in /var/tmp]: Triggered 'refresh' from 1 events
Notice: Finished catalog run in 725.40 seconds

root@ubuntu-server-12042-x64-vbox4210-nocm:~# ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

root@ubuntu-server-12042-x64-vbox4210-nocm:~# ll `which ruby`
-rwxr-xr-x 1 root root 8637004 Sep 24 03:32 /usr/local/bin/ruby*

@alvagante
Copy link
Member

Tested on an a clean vagrant box (without native ruby packages installed) it worked well.
Tested on the same box, recreated from scratch:

root@ubuntu1204-64:~# ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
root@ubuntu1204-64:~# which ruby
/opt/vagrant_ruby/bin/ruby

after an apt-get install ruby:

root@ubuntu1204-64:~# ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
root@ubuntu1204-64:~# which ruby
/usr/bin/ruby

after a vagrant provision with this code:

class { 'ruby':
  version             => '1.9.3-p392',
  compile_from_source => true,
}

I saw this output:

Macante:example42-test al$ vagrant provision Ubuntu1204_64
[Ubuntu1204_64] Running provisioner: puppet...
Running Puppet with init.pp...
stdin: is not a tty
info: Loading facts in /tmp/vagrant-puppet/modules-0/concat/lib/facter/concat_basedir.rb
info: Loading facts in /tmp/vagrant-puppet/modules-0/php/lib/facter/php_fact_extension_dir.rb
info: Loading facts in /tmp/vagrant-puppet/modules-0/php/lib/facter/php_fact_version.rb
info: Loading facts in /tmp/vagrant-puppet/modules-0/puppetdb/lib/facter/puppetdbversion.rb
info: Loading facts in /tmp/vagrant-puppet/modules-0/puppi/lib/facter/last_run.rb
info: Loading facts in /tmp/vagrant-puppet/modules-0/puppi/lib/facter/puppi_projects.rb
info: Loading facts in /tmp/vagrant-puppet/modules-0/rvm/lib/facter/rvm_installed.rb
info: Loading facts in /tmp/vagrant-puppet/modules-0/stdlib/lib/facter/facter_dot_d.rb
info: Loading facts in /tmp/vagrant-puppet/modules-0/stdlib/lib/facter/pe_version.rb
info: Loading facts in /tmp/vagrant-puppet/modules-0/stdlib/lib/facter/puppet_vardir.rb
info: Loading facts in /tmp/vagrant-puppet/modules-0/stdlib/lib/facter/root_home.rb
info: Applying configuration version '1380050715'
notice: /Stage[main]/Ruby::Compile/Puppi::Install_packages[ruby_compile_prerequisites]/File[/root/puppi_install_packages]/ensure: created
notice: /Stage[main]/Ruby::Compile/Puppi::Install_packages[ruby_compile_prerequisites]/File[install_packages_ruby_compile_prerequisites]/ensure: created
info: /Stage[main]/Ruby::Compile/Puppi::Install_packages[ruby_compile_prerequisites]/File[install_packages_ruby_compile_prerequisites]: Scheduling refresh of Exec[install_packages_ruby_compile_prerequisites]
err: /Stage[main]/Ruby::Compile/Puppi::Install_packages[ruby_compile_prerequisites]/Exec[install_packages_ruby_compile_prerequisites]: Failed to call refresh: Command exceeded timeout at /tmp/vagrant-puppet/modules-0/puppi/manifests/install_packages.pp:79
notice: /Stage[main]/Ruby::Compile/Puppi::Netinstall[ruby_source]/Exec[Retrieve http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.zip in /var/tmp]/returns: executed successfully
notice: /Stage[main]/Ruby::Compile/Puppi::Netinstall[ruby_source]/Exec[Extract ruby-1.9.3-p392.zip from /var/tmp]/returns: executed successfully
info: /Stage[main]/Ruby::Compile/Puppi::Netinstall[ruby_source]/Exec[Extract ruby-1.9.3-p392.zip from /var/tmp]: Scheduling refresh of Exec[PostExtract ruby-1.9.3-p392.zip in /var/tmp]
info: /Stage[main]/Ruby::Compile/Puppi::Netinstall[ruby_source]/Exec[Extract ruby-1.9.3-p392.zip from /var/tmp]: Scheduling refresh of Exec[Chown ruby-1.9.3-p392.zip in /var/tmp]
notice: /Stage[main]/Ruby::Compile/Puppi::Netinstall[ruby_source]/Exec[PostExtract ruby-1.9.3-p392.zip in /var/tmp]: Triggered 'refresh' from 1 events
notice: /Stage[main]/Ruby::Compile/Puppi::Netinstall[ruby_source]/Exec[Chown ruby-1.9.3-p392.zip in /var/tmp]: Triggered 'refresh' from 1 events
notice: Finished catalog run in 628.91 seconds

The timeout during the prerequisites installation didn't seem to be blocking, this is the result after this run:

root@ubuntu1204-64:~# ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
root@ubuntu1204-64:~# which ruby
/usr/local/bin/ruby
root@ubuntu1204-64:~# /usr/local/bin/ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]
root@ubuntu1204-64:~# /opt/vagrant_ruby/bin/ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [x86_64-linux]
root@ubuntu1204-64:~# /usr/bin/ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
root@ubuntu1204-64:~# /usr/bin/ruby1.8 -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
root@ubuntu1204-64:~# /usr/local/bin/ruby -v
ruby 1.9.3p392 (2013-02-22 revision 39386) [x86_64-linux]

So, when compiling from source the ruby binary is placed in /usr/local/bin, and you use it instead of the system's one according to your $PATH.

To me this seems a correct behaviour (I'd not overwrite /usr/bin/ruby ), but if you have remarks or suggestions let me know.

@spuder
Copy link
Contributor Author

spuder commented Oct 1, 2013

This does seem like the correct behavior. I think this information should be added to the documentation.

@alvagante
Copy link
Member

Can you make a pull request of https://github.com/spudstud/puppet-ruby/commit/2b55534ac221d4c3f96736c9a4181f9753d2bb2f ?
Will merge it directly.

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

2 participants