Discussion:
Bug: No json support anymore in Ruby 2.3.6
Ronald Fischer
2018-11-20 08:41:21 UTC
Permalink
Since I updated Ruby to 2.3.6, the standard library json is missing:

ruby -e 'require "json"'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- json (LoadError)
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'


The other standard libs which I tried, are present, for example:

ruby -e 'require "yaml"; require "set"'

(no error here).

Ronald
Ken Brown
2018-11-20 13:13:00 UTC
Permalink
Post by Ronald Fischer
ruby -e 'require "json"'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- json (LoadError)
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Install the ruby-json package.

Ken
B�KCB��؛[H�\ܝΈ����Y��[����K��؛[\˚[B��TN�����Y��[����K٘\K�B���[Y[�][ێ�����Y��[����K���˚[B�[��X��ܚX�H[��Έ����Y��[����K�[ ��[��X��ܚX
Brian Inglis
2018-11-20 14:00:20 UTC
Permalink
Post by Ken Brown
Post by Ronald Fischer
ruby -e 'require "json"'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- json (LoadError)
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Install the ruby-json package.
By recent ruby standards, ruby should depend on and install ruby-stdgems, which
should install ruby-libraries, ruby-default-gems, and ruby-bundled-gems, where
the latter two should depend on and install the lists of default and bundled
standard library gems, which should include ruby-json and other standard library
gems.

Packages for ruby-stdgems, ruby-default-gems, and ruby-bundled-gems could be
dummy (virtual) packages (like _obsolete packages) to define the generic and
version dependent gem lists, to make version dependent changes easier.

See https://stdgems.org/{libraries,default_gems,bundled_gems}.json
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Ronald Fischer
2018-11-20 15:39:14 UTC
Permalink
Hi Ken,

actually, the page regarding the gem list for the Ruby version in question (the one we have at Cygwin) is

https://stdgems.org/2.3.6/

but this page too lists json as "default gem".

The page https://stdgems.org/ then defines this term as:

"Default gems: These gems are part of Ruby and you can always require them directly"

So from this I would conclude that json (and the other default gems) should be part of the Ruby installation, since "they are part of Ruby". If you disagree with my interpretation, please explain where I undersood the text in a wrong way.

BTW, I think that my viewpoint is also supported by

https://ruby-doc.org/stdlib-2.3.6/

which says that the packages listed on this page are found in the /lib directory of Ruby.

But even if I go along with your interpretation of the text, in that the default gems are delivered as a separated package, they should be available at least on the Cygwin server, and be installable from there, but I did a search for "ruby-default" and could not get a match.

Ronald
Post by Brian Inglis
Post by Ken Brown
Post by Ronald Fischer
ruby -e 'require "json"'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- json (LoadError)
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Install the ruby-json package.
By recent ruby standards, ruby should depend on and install ruby-stdgems, which
should install ruby-libraries, ruby-default-gems, and ruby-bundled-gems, where
the latter two should depend on and install the lists of default and bundled
standard library gems, which should include ruby-json and other standard library
gems.
Packages for ruby-stdgems, ruby-default-gems, and ruby-bundled-gems could be
dummy (virtual) packages (like _obsolete packages) to define the generic and
version dependent gem lists, to make version dependent changes easier.
See https://stdgems.org/{libraries,default_gems,bundled_gems}.json
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada
This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Ken Brown
2018-11-20 16:26:17 UTC
Permalink
Post by Ronald Fischer
Hi Ken,
actually, the page regarding the gem list for the Ruby version in question (the one we have at Cygwin) is
https://stdgems.org/2.3.6/
but this page too lists json as "default gem".
"Default gems: These gems are part of Ruby and you can always require them directly"
So from this I would conclude that json (and the other default gems) should be part of the Ruby installation, since "they are part of Ruby". If you disagree with my interpretation, please explain where I undersood the text in a wrong way.
BTW, I think that my viewpoint is also supported by
https://ruby-doc.org/stdlib-2.3.6/
which says that the packages listed on this page are found in the /lib directory of Ruby.
But even if I go along with your interpretation of the text, in that the default gems are delivered as a separated package, they should be available at least on the Cygwin server, and be installable from there, but I did a search for "ruby-default" and could not get a match.
I was just trying to tell you how to solve the problem. I wasn't offering an
opinion about ruby packaging or which gems should be installed by default.

Ken
Т��Х&�&�V�&W�'G3��GG���7�wv���6���&�&�V�2��F��Фd��GG���7�wv���6���f�ФF�7V�V�FF�����GG���7�wv���6���F�72��F��ХV�7V'67&�&R��f���GG���7�wv���6������7V�7V'67&�
Ronald Fischer
2018-11-20 16:52:51 UTC
Permalink
Hi Ken.

I see your point .... For me, the foremost issue is to confirm, whether this is indeed a bug in the Cygwin package for Ruby, or not, and my posting on the mailing list was mainly intended to draw attention from the Ruby package maintainers (although other comments are, of course, also highly preciated, and in particular without your comment, I would not have known about the concept of default gems).

I have to maintain a consistent state of our application accross several sites (Cygwin, Linux), and so far, only the new 2.3.6 Cygwin version, which I installed tentaively, has this problem. The previous version was correct in this respect, and all those versions I'm aware of, which run on Linux, also come with json built in.

For the time being, we just avoid updating the Ruby version on Cygwin (because it seems to be nearly impossible to go back to the previous version once you have updated a package).

BTW, the definition of "default gems" provided on the stdgems site also includes the sentence that "one can not REMOVE them" (because they are bundled with Ruby), so I think it is even risky to deliver an explicit version of this gem as part of our application, which might then be in conflict with those installation which do contain the json gem in a different version. Furthermore, explicitly installing the json gem requires also to download the C compiler and the Cygwin library bindings for Ruby, because json contains C code. I rather would prefer not opening this can of worms....

Ronald
Post by Ken Brown
Post by Ronald Fischer
Hi Ken,
actually, the page regarding the gem list for the Ruby version in question (the one we have at Cygwin) is
https://stdgems.org/2.3.6/
but this page too lists json as "default gem".
"Default gems: These gems are part of Ruby and you can always require them directly"
So from this I would conclude that json (and the other default gems) should be part of the Ruby installation, since "they are part of Ruby". If you disagree with my interpretation, please explain where I undersood the text in a wrong way.
BTW, I think that my viewpoint is also supported by
https://ruby-doc.org/stdlib-2.3.6/
which says that the packages listed on this page are found in the /lib directory of Ruby.
But even if I go along with your interpretation of the text, in that the default gems are delivered as a separated package, they should be available at least on the Cygwin server, and be installable from there, but I did a search for "ruby-default" and could not get a match.
I was just trying to tell you how to solve the problem. I wasn't offering an
opinion about ruby packaging or which gems should be installed by default.
Ken
ТÒÐÐ¥&ö&ÆVÒ&W÷'G3¢‡GG¢òö7–wv–âæ6öÒ÷&ö&ÆV×2æ‡FÖÀФd¢‡GG¢òö7–wv–âæ6öÒöfðÐ
¤Fö7VÖVçFF–ö㢇GG¢òö7–wv–âæ6öÒöFö72æ‡FÖÀÐ¥Vç7V'67&–&R–æfó¢‡GG¢òö7–wv–
âæ6öÒöÖÂò7Vç7V'67&–&R×6–×ÆPРÐ
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Dan Kegel
2018-11-20 17:00:40 UTC
Permalink
Hey all,
looking at
http://mirrors.kernel.org/sourceware/cygwin/x86_64/setup.ini
I see that there is a ruby-json package:

@ ruby-json
sdesc: "Ruby JSON module"
...

but ruby does not currently depend on ruby-json:

@ ruby
sdesc: "Interpreted object-oriented scripting language"
...
requires: cygwin libcrypt0 libdb5.3 libffi6 libgcc1 libgdbm4 libgmp10
libopenssl100 libreadline7 libssp0 libyaml0_2 ruby-did_you_mean
ruby-psych ruby-rdoc rubygems zlib0
...
depends2: cygwin, libcrypt0, libdb5.3, libffi6, libgcc1, libgdbm4,
libgmp10, libopenssl100, libreadline7, ruby-did_you_mean, ruby-psych,
ruby-rdoc, rubygems, zlib0

Maybe rubygems should, let's see:

@ rubygems
sdesc: "Ruby module management system"
ldesc: "A centralized Ruby extension management system, similar to Perl's CPAN"
category: Ruby
requires: ca-certificates ruby ruby-builder ruby-io-console
ruby-minitest ruby-minitest4 ruby-psych ruby-rake ruby-rdoc
...
depends2: ca-certificates, ruby, ruby-builder, ruby-io-console,
ruby-minitest, ruby-psych, ruby-rake, ruby-rdoc

I am not a cygwin developer, but it does kind of sound like the rubygems package
might want to depend on the packages required to provide the 'default'
gems from stdgems.org.

The right way to phrase that request would be as a patch :-) if a
cygwin ruby user who needs it has the time and energy to get into
cygwin development.
- Dan

--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Brian Inglis
2018-11-20 19:10:07 UTC
Permalink
Post by Dan Kegel
Hey all,
looking at
http://mirrors.kernel.org/sourceware/cygwin/x86_64/setup.ini
@ ruby-json
sdesc: "Ruby JSON module"
...
@ ruby
sdesc: "Interpreted object-oriented scripting language"
...
depends2: cygwin, libcrypt0, libdb5.3, libffi6, libgcc1, libgdbm4,
libgmp10, libopenssl100, libreadline7, ruby-did_you_mean, ruby-psych,
ruby-rdoc, rubygems, zlib0
...
@ rubygems
sdesc: "Ruby module management system"
...
depends2: ca-certificates, ruby, ruby-builder, ruby-io-console,
ruby-minitest, ruby-psych, ruby-rake, ruby-rdoc
...
I am not a cygwin developer, but it does kind of sound like the rubygems
package might want to depend on the packages required to provide the
'default' gems from stdgems.org.
The right way to phrase that request would be as a patch :-) if a
cygwin ruby user who needs it has the time and energy to get into
cygwin development.
It's more a case of package.cygport tweaks by the ruby/library/-gems maintainer
to define packages and dependencies to get all required packages installed.

Dependencies are circular if gems depend on ruby, and ruby depends on the
standard library gems: how that is handled in packaging must be decided by the
maintainer, when they have time.

It might require a bit of restructuring so that e.g. exes and libs are packaged
as ruby-bin and ruby-lib, gems depend on bin and lib, and ruby only provides
global files but depends on all the standard bits to get them installed.

Like many developers I know enough about ruby to find and install packages I
need to run the tools I *use* sometimes, and hack a bit, but little more; same
for python, perl, .net, etc.
--
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Ronald Fischer
2018-11-20 15:17:17 UTC
Permalink
For modules which, according to the Ruby-Docs, are supposed to be in the stdlib, no Gem installation must be necessary.

With other words: A Ruby application which only uses features from the stdlib, should run on any other Ruby installation (of compatible version) without the requirement of installing a Gem.
Post by Ken Brown
Post by Ronald Fischer
ruby -e 'require "json"'
/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- json (LoadError)
from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
Install the ruby-json package.
Ken
B‹KCB”›и›[H™\мЮˆ‹ЫиоYнк[‹˜ллKм›и›[\Ыš[B‘TNˆ‹ЫиоYнк[‹˜ллKй˜\KУB‘ин[Y[]
[лŽˆ‹ЫиоYнк[‹˜ллKйимЫš[B•[œнXœимšX™H[™›Юˆ‹ЫиоYнк[‹˜ллKл[ Шн[œнXœимšX™K\к[\CBƒB
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Loading...