Error on require function (requiring Racc library)

Hello,

Each time i use the line "require ‘racc/parser.rb’ " i have an error :

Error: #<LoadError: cannot load such file -- racc/parser.rb>
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:59:in `require'
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:59:in `require'
<main>:in `<main>'

The problem is that this line is important to run new version of Nokogiri. I cant find a solution without download an Racc library and modify the path of this require in the code of Nokogiri. This solution is not good to deploy the plugins SketchUp and to maintain the plugins.

Did someone have an idea please ? thanks

REF … previous threads on Nokogiri:
https://forums.sketchup.com/search?q=nokogiri%20category%3A13

@thomthom: For some unknown reason the "racc" directory and it’s "parser.rb" file is missing in SU2019, but present in previous version builds. (… at least on the MS Windows editions.)

Weirdly, the "platform_specific/racc" directory and it’s compiled "cparse.so" (that "racc/parser.rb" loads,) is still present in SU2019’s "Tools/RubyStdLib" path.

1 Like

FWIW it is present on Mac and loads fine with a require in the Ruby Console.

@jeremie.berthillot

I believe it’s a licensing issue (LGPL)

Additionally, racc is an extension gem, and is not available pre-compiled for windows.

I could generate a pre-compiled gem on Appveyor, if that would be helpful…

That’s a good chance that’s the case. We had to prune out GPL licensed modules from the stdlib. Mostly that shouldn’t have been to much effect as it mostly appear to be related to CLI/building tools.

But I don’t recall of the top of my head if this particular one was related to that.

SU2019?

Hmm… thanks for pointing that out.

2 Likes

This is kind of messy with the changes in stdlib over the years, etc. It seems that the licensing of racc varies within it…

See:

GitHub ruby/racc GPL search

and

Odd thing is that many ‘organizations’ don’t want to include LGPL/GPL licensed code in their distributions, but as a user, I’m free to install it myself…

okay, I see they’ve removed files that had GPL license, and switched Racc from LGPL2 to the Ruby license.

Ref:

1 Like

Thanks Dan for your comment.
I struggled for 2 weeks to install NOKIGIRI under SU2019.
Point 1. NOKOGIRI is essential for me. (And I suppose for a lot of other people)
So a solution is to be found for the future releases of SU.

Point 2.
To circumvent the problem
“c:\Program Files\SketchUp\SketchUp 2018\Tools\RubyStdLib\racc” was copied to "“c:\Program Files\SketchUp\SketchUp 2019\Tools\RubyStdLib”

And NOKIGIRI loads without any problem

@tt_su Did you create a “to do” issue so that Racc can get back in the SU distro since it’s license is now the Ruby license ?

I might suggest copying files from one of the 64-bit (-x64) files at:

Thanks Dan,

I’ve just done it.

No actually you did not.

1. This forum’s Pro category is not where API issues / feature requests go. (I’m moving it to this category.)
2. API feature requests, documentation errors and bug reports are posted by users in the public SketchUp API issue tracker at GitHub: Issues · SketchUp/api-issue-tracker · GitHub
3. Then Thomas or another SketchUp employee will (after a discussion period) log them into their internal issue database software and add a “logged” tag.

2 Likes

Is it Ruby licensed in Ruby 2.5?

This commit says it’s against Racc VERSION 1.4.15

The last I can determine the version with SketchUp was 2018 and it’s “racc/parser.rb” file’s Parser class has constant:

Parser::Racc_Runtime_Version = '1.4.6'

The Racc project issue states he wants … “When it was merged this branch, We can merge racc-1.4.x to ruby core.”

He also has the word “Backport” in his issue title but this past May what was the current Ruby core, what was stable, and what core version was in maintenance ?

Checking Ruby branch ruby_2_5, I still see "ext/racc/cparse.c" is at version 1.4.5 **but it has a specific Ruby license comment:

And Ruby branch ruby_2_5, I see "lib/racc/parser.rb" is at version 1.4.6

… and has a specific Ruby license comment …


I found the Ruby branch ruby_2_5 pull request by hsbt to merge in the latest Racc 1.4.x changes to the Ruby core

Thanks. We’re looking into this one.

1 Like

FYI … The SketchUp 2020.0 release has restored the Racc library. See release notes.