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

fpm 1.13 seems broken on CentOS7 / ruby 2.0 #1798

Closed
bersace opened this issue Jun 25, 2021 · 11 comments
Closed

fpm 1.13 seems broken on CentOS7 / ruby 2.0 #1798

bersace opened this issue Jun 25, 2021 · 11 comments

Comments

@bersace
Copy link

bersace commented Jun 25, 2021

Hi,

Installing fpm on ruby 2.0 looks broken due to rexml dependency:

Successfully installed fpm-1.13.0                                                                                                                                                                                                       
11 gems installed                                                                                                                                                                                                                       
+ fpm --version                                                                                                                                                                                                                         
/usr/local/share/gems/gems/rexml-3.2.5/lib/rexml/xpath_parser.rb:12: warning: Refinements are experimental, and the behavior may change in future versions of Ruby!                                                                     
/usr/local/share/gems/gems/rexml-3.2.5/lib/rexml/document.rb:12:in `require_relative': /usr/local/share/gems/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:515: syntax error, unexpected ',' (SyntaxError)                           
/usr/local/share/gems/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:542: syntax error, unexpected ','                                                                                                                                
/usr/local/share/gems/gems/rexml-3.2.5/lib/rexml/parsers/baseparser.rb:673: syntax error, unexpected keyword_end, expecting end-of-input                                                                                                
        from /usr/local/share/gems/gems/rexml-3.2.5/lib/rexml/document.rb:12:in `<top (required)>'                                                                                                                                      
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'                                                                                                                                                    
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'                                                                                                                                                    
        from /usr/local/share/gems/gems/fpm-1.13.0/lib/fpm/package/osxpkg.rb:7:in `<top (required)>'                                                                                                                                    
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'                                                                                                                                                    
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'                                                                                                                                                    
        from /usr/local/share/gems/gems/fpm-1.13.0/lib/fpm.rb:15:in `<top (required)>'                                                                                                                                                  
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'                                                                                                                                                    
        from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'                                                                                                                                                    
        from /usr/local/share/gems/gems/fpm-1.13.0/bin/fpm:4:in `<top (required)>'                                                                                                                                                      
        from /usr/local/bin/fpm:23:in `load'                                                                                                                                                                                            
        from /usr/local/bin/fpm:23:in `<main>'     

Do you have a clue on how to install fpm 1.13 on ruby 2.0 ? fpm 1.12 works fine.

@opankiw-irronnet
Copy link

opankiw-irronnet commented Jun 29, 2021

I was able to get this to work with ruby 2.0.0 by pinning back rexml to pre- 3.2.5. Rexml is known to be broken with ruby < 2.3, and it looks like the rexml change was only tested with 2.7.0 + #1794 .

You can also get newer ruby versions via centos_scl repos but you will have to deal with scl nuances like environment variables #1783. Starting at ruby23, it started working for me

@jordansissel
Copy link
Owner

Dang. Thanks for filing this.

I think we can solve this the same way as #1795 -- removing rexml as a dependency. I'll file a separate issue to track that.

@jamshid
Copy link

jamshid commented Feb 17, 2022

This is probably overkill but if you're on centos 7 and in ruby/gem version hell these commands get a working fpm 1.14 installed:

# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
# yum install -y sudo expect make gcc gawk ruby-devel rubygems rpm-build && echo "gem: --no-document --no-rdoc --no-ri" > ~/.gemrc
# gem install --version 1.12.2 --user-install ffi && gem install --version 1.6.0 --user-install git && gem install --version 0.9.10 --user-install rb-inotify && gem install --version 3.2.3  --user-install rexml
# gem install backports -v 3.21.0 && gem install fpm
# fpm --version
1.14.1

If you get this error try gem uninstall backports to remove this later version.

# fpm --version
/usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/cloner.rb:36:in `private': nil is not a symbol (TypeError)

@iainhallam
Copy link

Now runs into issues with public_suffix and addressable. So as of today the list is:

$ gem install --user-install ffi --version 1.12.2
$ gem install --user-install git --version 1.6.0
$ gem install --user-install rb-inotify --version 0.9.10
$ gem install --user-install rexml --version 3.2.3
$ gem install --user-install public_suffix --version 2.0.5
$ gem install --user-install backports --version  3.21.0
$ gem install --user-install fpm
$ fpm --version
1.14.2

@bersace
Copy link
Author

bersace commented Sep 13, 2022

I'm looking at nfpm.

@jordansissel
Copy link
Owner

@iainhallam public_suffix/addressable problem was fixed in #1946 by removing the git gem dependency. I'm hoping to get a release done soon with this published.

@jordansissel
Copy link
Owner

#1950 should fix the rexml failure by delaying the loading of rexml until it is needed. In practice, this will mostly mean that older rubies with this rexml problem will not be able to create osxpkg format, but everything else should work .

jordansissel added a commit that referenced this issue Nov 3, 2022
This helps avoid a startup crash on Ruby 1.9.3 where the `rexml` gem
crashes when loaded due to syntax errors.

Fixes #1798, #1800, #1784
jordansissel added a commit that referenced this issue Nov 3, 2022
This helps avoid a startup crash on Ruby 1.9.3 where the `rexml` gem
crashes when loaded due to syntax errors.

Fixes #1798, #1800, #1784
jordansissel added a commit that referenced this issue Nov 4, 2022
This helps avoid a startup crash on Ruby 1.9.3 where the `rexml` gem
crashes when loaded due to syntax errors.

Fixes #1798, #1800, #1784
@jordansissel
Copy link
Owner

fpm 1.15.0 is released and, I believe, has resolve this issue. Please let me know if you find otherwise in a new issue (if a new problem) or this issue (if same problem)

@elschman
Copy link

Seems to be not :-(

[me@centos79 ~]$ fpm --version
/usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/cloner.rb:36:in private': nil is not a symbol (TypeError) from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/cloner.rb:36:in class:Cloner'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/cloner.rb:7:in <class:Ractor>' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/cloner.rb:6:in module:Backports'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/cloner.rb:5:in <top (required)>' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/ractor.rb:9:in require_relative'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/ractor.rb:9:in <class:Ractor>' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/ractor.rb:6:in module:Backports'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/ractor.rb:5:in <top (required)>' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/3.0.0/ractor.rb:18:in require_relative'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/3.0.0/ractor.rb:18:in <top (required)>' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/tools/require_relative_dir.rb:12:in require_relative'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/tools/require_relative_dir.rb:12:in block in require_relative_dir' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/tools/require_relative_dir.rb:9:in each'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/tools/require_relative_dir.rb:9:in require_relative_dir' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/3.0.0.rb:3:in <top (required)>'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/3.1.0.rb:2:in <top (required)>' from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/latest.rb:4:in <top (required)>'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/local/share/gems/gems/fpm-1.15.0/lib/fpm/package.rb:7:in <top (required)>' from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/share/gems/gems/fpm-1.15.0/lib/fpm.rb:3:in <top (required)>'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/local/share/gems/gems/fpm-1.15.0/bin/fpm:4:in <top (required)>' from /usr/local/bin/fpm:23:in load'
from /usr/local/bin/fpm:23:in `

'

@sivabalan
Copy link

sivabalan commented Feb 10, 2023

Same issue as above with fpm1.15.1

`[root@592fc84542b0 project]# fpm --version

/usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/cloner.rb:36:in private': nil is not a symbol (TypeError) from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/cloner.rb:36:in class:Cloner'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/cloner.rb:7:in <class:Ractor>' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/cloner.rb:6:in module:Backports'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/cloner.rb:5:in <top (required)>' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/ractor.rb:9:in require_relative'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/ractor.rb:9:in <class:Ractor>' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/ractor.rb:6:in module:Backports'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/ractor/ractor.rb:5:in <top (required)>' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/3.0.0/ractor.rb:18:in require_relative'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/3.0.0/ractor.rb:18:in <top (required)>' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/tools/require_relative_dir.rb:12:in require_relative'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/tools/require_relative_dir.rb:12:in block in require_relative_dir' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/tools/require_relative_dir.rb:9:in each'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/tools/require_relative_dir.rb:9:in require_relative_dir' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/3.0.0.rb:3:in <top (required)>'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/3.1.0.rb:2:in <top (required)>' from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/share/gems/gems/backports-3.23.0/lib/backports/latest.rb:4:in <top (required)>'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/local/share/gems/gems/fpm-1.15.1/lib/fpm/package.rb:7:in <top (required)>' from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/local/share/gems/gems/fpm-1.15.1/lib/fpm.rb:3:in <top (required)>'
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'
from /usr/local/share/gems/gems/fpm-1.15.1/bin/fpm:4:in <top (required)>' from /usr/local/bin/fpm:23:in load'
from /usr/local/bin/fpm:23:in <main>'

@phat-pat
Copy link

I only needed part of an earlier solution to get this working.

gem uninstall backports
gem install backports -v 3.21.0

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

8 participants