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

"uninitialized constant" error with fpm 1.6 #1148

Closed
7AC opened this Issue Jul 1, 2016 · 6 comments

Comments

Projects
None yet
4 participants
@7AC

7AC commented Jul 1, 2016

I get this error with fpm 1.6.2, works fine with 1.5.0.

# fpm -s python -t rpm protobuf
/home/gvalente/.gem/ruby/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:9:in `has_issue_1608?': uninitialized constant FPM::Issues::TarWriter::StringIO (NameError)
        from /home/gvalente/.gem/ruby/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:18:in `has_issues_with_split_name?'
        from /home/gvalente/.gem/ruby/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:32:in `<class:TarWriter>'
        from /home/gvalente/.gem/ruby/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:31:in `<top (required)>'
        from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
        from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
        from /home/gvalente/.gem/ruby/1.9.1/gems/fpm-1.6.2/lib/fpm/util.rb:358:in `<top (required)>'
        from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
        from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
        from /home/gvalente/.gem/ruby/1.9.1/gems/fpm-1.6.2/lib/fpm/package.rb:2:in `<top (required)>'
        from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
        from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
        from /home/gvalente/.gem/ruby/1.9.1/gems/fpm-1.6.2/lib/fpm.rb:3:in `<top (required)>'
        from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
        from /usr/share/rubygems/rubygems/custom_require.rb:36:in `require'
        from /home/gvalente/.gem/ruby/1.9.1/gems/fpm-1.6.2/bin/fpm:5:in `<top (required)>'
        from /home/gvalente/bin/fpm:23:in `load'
        from /home/gvalente/bin/fpm:23:in `<main>'
# ruby --version
ruby 1.9.3p484 (2013-11-22 revision 43786) [i386-linux]

@7AC 7AC changed the title from "uninitialized constant" constant error with fpm 1.6 to "uninitialized constant" error with fpm 1.6 Jul 1, 2016

@jcm2007

This comment has been minimized.

jcm2007 commented Sep 20, 2016

Yes,i get this error also.

@7AC

This comment has been minimized.

7AC commented Sep 23, 2016

This workaround gets you going:

gem uninstall fpm
gem install fpm -v 1.5.0
@jairov4

This comment has been minimized.

jairov4 commented Oct 15, 2016

< 1.5.x in CentOS6 creates unusable RPMs that fails with cpio: Digest mismatch

1.6.x in CentOS6 fails because of this.
Im blocked :(

@josegonzalez

This comment has been minimized.

Collaborator

josegonzalez commented Nov 22, 2016

Seeing the same issue from our build process under a Docker container running Ubuntu 14.04. Here is the build output:

['fpm', '-t', 'deb', '-s', 'dir', '-C', '/tmp', '--name', 'wiki-3e6f01d287dd55087d861e1e09dc4eb8d9a55092', '--architecture', 'amd64', '--package', '/tmp/wiki-3e6f01d287dd55087d861e1e09dc4eb8d9a55092.deb', '--category', 'web', '--description', 'Package for installing wiki at commit 3e6f01d287dd55087d861e1e09dc4eb8d9a55092', '--maintainer', 'SeatGeek Operations <hi@example.com>', '--version', '1.0', '--deb-pre-depends', 'debconf', '--deb-pre-depends', 'debconf-utils', '--deb-pre-depends', 'gliderlabs-sigil', '--deb-pre-depends', 'colordiff', '--deb-pre-depends', 'python-s3cmd', '--after-install', '/app/post-install', '--deb-pre-depends', u'libicu-dev', '--deb-pre-depends', u'ruby1.9.3', '--deb-pre-depends', u'ruby-switch', '/apps', 'etc']
/var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:9:in `has_issue_1608?': uninitialized constant FPM::Issues::TarWriter::StringIO (NameError)
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:18:in `has_issues_with_split_name?'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:32:in `<class:TarWriter>'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:31:in `<top (required)>'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/util.rb:358:in `<top (required)>'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/package.rb:2:in `<top (required)>'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm.rb:3:in `<top (required)>'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/bin/fpm:5:in `<top (required)>'
	from /usr/local/bin/fpm:23:in `load'
	from /usr/local/bin/fpm:23:in `<main>'
/var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:9:in `has_issue_1608?': uninitialized constant FPM::Issues::TarWriter::StringIO (NameError)
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:18:in `has_issues_with_split_name?'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:32:in `<class:TarWriter>'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/util/tar_writer.rb:31:in `<top (required)>'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/util.rb:358:in `<top (required)>'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm/package.rb:2:in `<top (required)>'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/lib/fpm.rb:3:in `<top (required)>'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
	from /var/lib/gems/1.9.1/gems/fpm-1.6.2/bin/fpm:5:in `<top (required)>'
	from /usr/local/bin/fpm:23:in `load'
	from /usr/local/bin/fpm:23:in `<main>'

Going to investigate and see if I can't drum up the real issue...

josegonzalez added a commit to josegonzalez/fpm that referenced this issue Nov 22, 2016

@josegonzalez

This comment has been minimized.

Collaborator

josegonzalez commented Nov 22, 2016

Patch made, wasn't too hard.

For those of you following along, it seems as though Ruby got confused and looked in the current namespace for StringIO under at least ruby 1.9.3 (what I was running under). Prefixing with a :: made it look at the top-level namespace, which should fix the issue.

@josegonzalez

This comment has been minimized.

Collaborator

josegonzalez commented Nov 22, 2016

Oi I'm a noob, you need to require 'stringio' to fix it :P

josegonzalez added a commit to josegonzalez/fpm that referenced this issue Nov 22, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment