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

hiera-eyaml gem should work with system hiera (and not require rubygem hiera) #80

Closed
shawn-sterling opened this issue Mar 25, 2014 · 6 comments · Fixed by #87
Closed

Comments

@shawn-sterling
Copy link

Hello, I created rpms to install the hiera-eyaml gems (my work environment requires this) using fpm.

I have the puppetlabs hiera installed, and would prefer to stick with the puppetlabs version.

# rpm -qa |grep hiera
hiera-1.3.0-1.el6.noarch

which installs to:
/usr/lib/ruby/site_ruby/1.8/hiera

When I install the rubygems (rubygem-hiera-eyaml-2.0.1-1.noarch, rubygem-highline-1.6.21-1.noarch, rubygem-trollop-2.0.0-1.noarch) and try and use eyaml, I get:

# eyaml createkeys
/usr/lib/ruby/site_ruby/1.8/rubygems.rb:779:in `report_activate_error': Could not find RubyGem hiera (>= 1.2.1) (Gem::LoadError)
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:214:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:249:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `each'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:248:in `activate'
from /usr/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in `gem'
from /usr/bin/eyaml:18

I tried to symlink /usr/lib/ruby/site_ruby/1.8/hiera to /usr/lib/ruby/gems/1.8/gems/hiera-1.3.0 to no avail.

I can install fine doing a normal gem install, but the gem install overwrites the system hiera binary, and because the gem overwrites /usr/bin/hiera the next time puppetlabs updates their hiera rpm it's going to overwrite the gem binary and possibly cause problems.

Let me know if there is any other information you require.

Have a good day.

-Shawn

@sihil
Copy link
Collaborator

sihil commented Mar 26, 2014

Yep, this has bitten me too and changed in the most recent version when hiera was made a dependency in the gem.

Ideally there should be a really easy way of telling fpm to drop a dependency (e.g. --exclude-dep hiera) but in the absence of such a feature we could look at removing the dependency from our side, even though it makes a lot of sense to have it in most environments.

@shawn-sterling
Copy link
Author

Actually it easy easy for you to do that in fpm. Just add a "-e" flag and that will allow you to edit the spec file, so there is no rpm dependency for the rubygem-hiera-eyaml. I should have mentioned that I already did this, and it failed.

The gem hiera-eyaml is requiring the gem hiera.

Does that make sense?

-Shawn

@sihil
Copy link
Collaborator

sihil commented Mar 26, 2014

I think so... the dependency is evaluated by RubyGem at runtime as well as install time.

Didn't realise that Ruby did that, but makes sense. I ended up building my own gem without the dep so I could build an RPM from it.

I wonder if FPM can be made to deeply remove the dependency when converting from a gem - i.e. remove it from the metadata as well as simply drop it from the RPM

@denmat
Copy link

denmat commented Mar 31, 2014

Hi,

this is biting me too. Any chance we could stick the dependency in the Gemfile?

I actually get this error which is really confusing:

Error 400 on SERVER: undefined method `read_file' for #<Hiera::Filecache:0x7fb5d43b0948 @cache={}> 

(I updated to this version of hiera-eyaml because of #78)

@shawn-sterling
Copy link
Author

Hi denmat,

I was getting similar errors here: #82

You may want to try what I did for the interim.

Take it easy.

-Shawn

@robinbowes
Copy link

This is a "me too" post. We're using Puppet Enterprise (which comes with pe-hiera) and have generated RPMs for all rubygems that we use. There is no hiera gem installed. Additionally, pe-hiera obsoletes pe-rubygem-hiera so it is not possible to install it. The only work around I have found is to "gem install hiera" but this is not possible in all our environments. Another possibility would be to remove the dependency from the RPM when we build from the gem.

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

Successfully merging a pull request may close this issue.

4 participants