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

gem install generates wrong json-2.6.2.gemspec file #505

Closed
Segaja opened this issue Oct 10, 2022 · 7 comments
Closed

gem install generates wrong json-2.6.2.gemspec file #505

Segaja opened this issue Oct 10, 2022 · 7 comments

Comments

@Segaja
Copy link

Segaja commented Oct 10, 2022

Running gem install on https://rubygems.org/downloads/json-2.6.2.gem results in a default gemspec file like this:

# -*- encoding: utf-8 -*-
# stub: json 2.6.2 ruby lib
# stub: ext/json/ext/generator/extconf.rbext/json/ext/parser/extconf.rbext/json/extconf.rb

Gem::Specification.new do |s|
  s.name = "json".freeze
  s.version = "2.6.2"

  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
  s.metadata = { "bug_tracker_uri" => "https://github.com/flori/json/issues", "changelog_uri" => "https://github.com/flori/json/blob/master/CHANGES.md", "documentation_uri" => "http://flori.github.io/json/doc/index.html", "homepage_uri" => "http://flori.github.io/json/", "source_code_uri" => "https://github.com/flori/json", "wiki_uri" => "https://github.com/flori/json/wiki" } if s.respond_to? :metadata=
  s.require_paths = ["lib".freeze]
  s.authors = ["Florian Frank".freeze]
  s.date = "2022-05-16"
  s.description = "This is a JSON implementation as a Ruby extension in C.".freeze
  s.email = "flori@ping.de".freeze
  s.extensions = ["ext/json/ext/generator/extconf.rb".freeze, "ext/json/ext/parser/extconf.rb".freeze, "ext/json/extconf.rb".freeze]
  s.extra_rdoc_files = ["README.md".freeze]
  s.files = ["README.md".freeze, "ext/json/ext/generator/extconf.rb".freeze, "ext/json/ext/parser/extconf.rb".freeze, "ext/json/extconf.rb".freeze]
  s.homepage = "http://flori.github.com/json".freeze
  s.licenses = ["Ruby".freeze]
  s.rdoc_options = ["--title".freeze, "JSON implementation for Ruby".freeze, "--main".freeze, "README.md".freeze]
  s.required_ruby_version = Gem::Requirement.new(">= 2.3".freeze)
  s.rubygems_version = "3.2.33".freeze
  s.summary = "JSON Implementation for Ruby".freeze

  s.installed_by_version = "3.2.33" if s.respond_to? :installed_by_version
end

The problem in this is that the s.files list doesn't list the actual json .rb files.

To fix that you have to run gem install --default on the same gem to a different folder and then copy the gemspec to the right place.

@hsbt
Copy link
Member

hsbt commented Oct 10, 2022

It's expected. json is C extension version for JSON. json_pure is pure Ruby implementation for JSON. .rb files are provided by json_pure.

@hsbt hsbt closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2022
@Segaja
Copy link
Author

Segaja commented Oct 11, 2022

And which version is provided in upstream ruby? json or json_pure?

@hsbt
Copy link
Member

hsbt commented Oct 11, 2022

It's json.

@Segaja
Copy link
Author

Segaja commented Oct 11, 2022

Hm, but the .gemspec file that is present in the main ruby installation has all the .rb files listed and not only the extensions. How is this done?

@hsbt
Copy link
Member

hsbt commented Oct 11, 2022

Do you mean extconf.rb? I'm not sure what you want to do.

@Segaja
Copy link
Author

Segaja commented Oct 11, 2022

I'm trying to recreate how the default gem json is build and stumbled over this issue of the json gemspec.

@hsbt
Copy link
Member

hsbt commented Oct 11, 2022

I strongly don't recommend it. The default gems are only ruby installation usage, not separated package like ruby-json on Arch, Fedora or Debian.

It's not supported officially. So, It's totally package maintainers responsibility of their distribution.

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