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

Bundler doesn't get installed automatically. #60

Closed
keynmol opened this issue Feb 12, 2013 · 11 comments
Closed

Bundler doesn't get installed automatically. #60

keynmol opened this issue Feb 12, 2013 · 11 comments

Comments

@keynmol
Copy link

keynmol commented Feb 12, 2013

So I finally got my puppet configuration to work. Manifest site.pp on Master:

node 'puppet' {
    rbenv::install{"puppetuser":}
    rbenv::compile{"1.9.3-p374":
        user => "puppetuser",
        global=>true,
        require => Rbenv::Install["puppetuser"]
    }
}

Immediately after installation I ran "rbenv shims" and was quite suprised to not find bundler in the list although everything else worked as expected:

puppetuser@puppet:~$ rbenv shims
/home/puppetuser/.rbenv/shims/erb
/home/puppetuser/.rbenv/shims/gem
/home/puppetuser/.rbenv/shims/irb
/home/puppetuser/.rbenv/shims/rake
/home/puppetuser/.rbenv/shims/rdoc
/home/puppetuser/.rbenv/shims/ri
/home/puppetuser/.rbenv/shims/ruby
/home/puppetuser/.rbenv/shims/testrb
puppetuser@puppet:~$ rbenv versions
  system
* 1.9.3-p374 (set by /home/puppetuser/.rbenv/version)
puppetuser@puppet:~$ ruby -v
ruby 1.9.3p374 (2013-01-15 revision 38858) [i686-linux]
puppetuser@puppet:~$ 

When I added this to my manifest:

    rbenv::gem{"bundler":
        user=>"puppetuser",
        ruby=>"1.9.3-p374"
    }

all hell broke loose:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Rbenvgem[puppetuser/1.9.3-p374/bundler/present] is already declared in file /etc/puppet/modules/rbenv/manifests/gem.pp at line 28; cannot redeclare at /etc/puppet/modules/rbenv/manifests/gem.pp:28 on node puppet
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

Which should mean that bundler is installed, right? But Gem has a different opinion:

puppetuser@puppet:~$ gem list

*** LOCAL GEMS ***

bigdecimal (1.1.0)
io-console (0.3)
json (1.5.4)
minitest (2.5.1)
rake (0.9.2.2)
rdoc (3.9.4)

What is that? What should I do?

_UPDATE_: for the sake of experiment I added another version of ruby:

rbenv::compile{"2.0.0-rc2":
                user=>"puppetuser",
                require=>Rbenv::Install["puppetuser"]
        }

And bundler didn't get installed either:

puppetuser@puppet:~$ sudo puppet agent -t --server=puppetmaster
info: Caching catalog for puppet
info: Applying configuration version '1360662742'
notice: /Stage[main]//Node[puppet]/Rbenv::Compile[2.0.0-rc2]/Exec[rbenv::compile puppetuser 2.0.0-rc2]/returns: executed successfully
notice: /Stage[main]//Node[puppet]/Rbenv::Compile[2.0.0-rc2]/Exec[rbenv::rehash puppetuser 2.0.0-rc2]/returns: executed successfully
notice: Finished catalog run in 571.99 seconds
@fgrehm
Copy link
Contributor

fgrehm commented Feb 14, 2013

I haven't had the chance to look into this yet but looks like it might be related to #59

fgrehm added a commit to fgrehm/puppet-rbenv-issues that referenced this issue Feb 16, 2013
@fgrehm
Copy link
Contributor

fgrehm commented Feb 16, 2013

I've tried to reproduce the issue with vagrant at https://github.com/fgrehm/puppet-rbenv-issues but wasn't able to reproduce it. Are you using the most recent code from this repo or are you installing from puppet forge?

@fgrehm
Copy link
Contributor

fgrehm commented Feb 16, 2013

Oh, and regarding the issue you had when declaring bundler yourself:

err: Could not retrieve catalog from remote server: Error 400 on SERVER: Duplicate declaration: Rbenvgem[puppetuser/1.9.3-p374/bundler/present] is already declared in file /etc/puppet/modules/rbenv/manifests/gem.pp at line 28; cannot redeclare at /etc/puppet/modules/rbenv/manifests/gem.pp:28 on node puppet
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run

The problem is that this module automatically declares the same rbenv::gem resource for you when compiling rubies and puppet complains about the duplicate declaration, it doesn't necessarily mean that the gem was installed ;-)

@keynmol
Copy link
Author

keynmol commented Feb 16, 2013

I am using puppet forge version. That duplicating issue I've already figured out, looked into sources. I believe then there's something wrong with puppet forge version?

@fgrehm
Copy link
Contributor

fgrehm commented Feb 17, 2013

In that case probably yes, need to check with @alup when was the last
version released.

Fábio Rehm
Sent from my phone
On Feb 16, 2013 4:21 PM, "velvetbaldmime" notifications@github.com wrote:

I am using puppet forge version. That duplicating issue I've already
figured out, looked into sources. I believe then there's something wrong
with puppet forge version?


Reply to this email directly or view it on GitHubhttps://github.com//issues/60#issuecomment-13663877.

@fgrehm
Copy link
Contributor

fgrehm commented Feb 17, 2013

hey @keynmol, @alup has just released a new version to the forge, would you be able to try it out again and post the results here?

@keynmol
Copy link
Author

keynmol commented Feb 24, 2013

No luck yet.

My manifest:

node 'puppet' {
    rbenv::install{"puppet":}
    rbenv::compile{"1.9.3-p374":
        user => "puppet",
        global=>true,
        require => Rbenv::Install["puppet"]
    }
}

Running it on a clean installed VM with ubuntu server 12.10:

puppet@puppet:~$ sudo puppet agent -t --server=master
info: Caching catalog for puppet
info: Applying configuration version '1361698911'
notice: /Stage[main]/Rbenv::Dependencies::Ubuntu/Package[build-essential]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Rbenv::Dependencies::Ubuntu/Package[libxslt1-dev]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Rbenv::Dependencies::Ubuntu/Package[git]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Rbenv::Dependencies::Ubuntu/Package[libssl-dev]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Rbenv::Dependencies::Ubuntu/Package[libyaml-dev]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Rbenv::Dependencies::Ubuntu/Package[autoconf]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Rbenv::Dependencies::Ubuntu/Package[bison]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]/Rbenv::Dependencies::Ubuntu/Package[libreadline6-dev]/ensure: ensure changed 'purged' to 'present'
notice: /Stage[main]//Node[puppet]/Rbenv::Install[puppet]/Exec[rbenv::checkout puppet]/returns: executed successfully
notice: /Stage[main]//Node[puppet]/Rbenv::Install[puppet]/File[rbenv::cache-dir puppet]/ensure: created
notice: /Stage[main]//Node[puppet]/Rbenv::Install[puppet]/File[rbenv::rbenvrc puppet]/ensure: defined content as '{md5}d2817b1c5bf3b27742b1006d9770c25f'
notice: /Stage[main]//Node[puppet]/Rbenv::Install[puppet]/Exec[rbenv::shrc puppet]/returns: executed successfully
notice: /Stage[main]//Node[puppet]/Rbenv::Compile[1.9.3-p374]/Rbenv::Plugin::Rubybuild[rbenv::rubybuild::puppet]/Rbenv::Plugin[rbenv::plugin::rubybuild::puppet]/File[rbenv::plugins puppet]/ensure: created
notice: /Stage[main]//Node[puppet]/Rbenv::Compile[1.9.3-p374]/Rbenv::Plugin::Rubybuild[rbenv::rubybuild::puppet]/Rbenv::Plugin[rbenv::plugin::rubybuild::puppet]/Exec[rbenv::plugin::checkout puppet ruby-build]/returns: executed successfully
notice: /Stage[main]//Node[puppet]/Rbenv::Compile[1.9.3-p374]/Exec[rbenv::compile puppet 1.9.3-p374]/returns: executed successfully
notice: /Stage[main]//Node[puppet]/Rbenv::Compile[1.9.3-p374]/Exec[rbenv::rehash puppet 1.9.3-p374]/returns: executed successfully
notice: /Stage[main]//Node[puppet]/Rbenv::Compile[1.9.3-p374]/File[rbenv::global puppet]/ensure: defined content as '{md5}a5cbdc517333c90f4a2e7199f1786298'
notice: Finished catalog run in 516.41 seconds
puppet@puppet:~$ rbenv -v
rbenv 0.4.0-15-g0d1f1d0
puppet@puppet:~$ which gem
/home/puppet/.rbenv/shims/gem
puppet@puppet:~$ rbenv version
1.9.3-p374 (set by /home/puppet/.rbenv/version)
puppet@puppet:~$ gem list

*** LOCAL GEMS ***

bigdecimal (1.1.0)
io-console (0.3)
json (1.5.4)
minitest (2.5.1)
rake (0.9.2.2)
rdoc (3.9.4)
puppet@puppet:~$ bundle
The program 'bundle' can be found in the following packages:
 * bundler
 * ruby-bundler
Try: sudo apt-get install <selected package>
puppet@puppet:~$ 

As if puppet somehow ignores bundle resource :(

@fgrehm
Copy link
Contributor

fgrehm commented Feb 25, 2013

Just checking, have you got pluginsync enabled?

@keynmol
Copy link
Author

keynmol commented Feb 25, 2013

Bloody hell. I should've read main page from top to bottom. Perhaps though this would better somewhere higher on page, or highlighted in red, or something like that.

Thanks.

@keynmol keynmol closed this as completed Feb 25, 2013
@fgrehm
Copy link
Contributor

fgrehm commented Feb 25, 2013

Awesome!
In fact, that section is brand new to the README, it wasn't there when you reported the issue ;-)

@keynmol
Copy link
Author

keynmol commented Feb 25, 2013

You made me feel much better, thank you :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants