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

Debian package is broken #106

Closed
stefansundin opened this issue Nov 24, 2017 · 3 comments
Closed

Debian package is broken #106

stefansundin opened this issue Nov 24, 2017 · 3 comments

Comments

@stefansundin
Copy link
Contributor

Hello there,

I realize that this is not directly your fault, since you most likely didn't package the ruby-toml-rb package that is in debian and ubuntu. However, it seems that the cause of their mistake is that they did not include the init.rb file when they packaged it. I must ask you, why is the file outside of the lib directory?

It appears that it's only required by lib/toml-rb.rb on the first line. Can we just move that there? I don't understand the point of the init file at all.

Here's the error I get:

irb(main):001:0> require 'toml-rb'
LoadError: cannot load such file -- /usr/lib/ruby/init
 from /usr/lib/ruby/vendor_ruby/toml-rb.rb:1:in `require_relative'
 from /usr/lib/ruby/vendor_ruby/toml-rb.rb:1:in `<top (required)>'
 from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
 from (irb):1
 from /usr/bin/irb:11:in `<main>'

Here's a question I submitted to the Ubuntu package: https://answers.launchpad.net/ubuntu/+source/ruby-toml-rb/+question/661049

From what I can see, there are two ways to fix this:

  1. Wait for the debian/ubuntu developers to fix their tooling to include init.rb in their package.
  2. We move the things in init.rb to lib/toml-rb.rb and release a new version, and they will pick it up in 6-12 months.

I suspect the second option would be faster than the first option. If you agree, then I can submit a PR for it.

Thanks!

@emancu
Copy link
Owner

emancu commented Nov 24, 2017

Sure, go ahead and send a PR!

@emancu
Copy link
Owner

emancu commented Nov 25, 2017

@stefansundin Pushed new version v1.1.1

Thanks for taking care of this issue!

@stefansundin
Copy link
Contributor Author

Thank you, I can confirm that it is working if I replace the file.

$ sudo apt install ruby-toml-rb
$ ruby -e 'require "toml-rb"; puts TomlRB.parse("[test]")'
/usr/lib/ruby/vendor_ruby/toml-rb.rb:1:in `require_relative': cannot load such file -- /usr/lib/ruby/init (LoadError)
	from /usr/lib/ruby/vendor_ruby/toml-rb.rb:1:in `<top (required)>'
	from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from -e:1:in `<main>'
$ sudo curl -o /usr/lib/ruby/vendor_ruby/toml-rb.rb https://raw.githubusercontent.com/emancu/toml-rb/master/lib/toml-rb.rb
$ ruby -e 'require "toml-rb"; puts TomlRB.parse("[test]")'
{"test"=>{}}

Now I just have to convince someone to update the package..

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