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

Error: #<NameError: uninitialized constant JSON::VERSION_MAJOR on Sketchup 2024.0.594 #52

Open
nanachi-code opened this issue Jan 20, 2025 · 1 comment

Comments

@nanachi-code
Copy link

I'm writing a plugin using Bridge and after a restart this just showed up. I checked some of the constants and turned out only VERSION is available (2.9.1), VERSION_MAJOR, VERSION_MINOR, VERSION_ARRAY are all missing. I'm not sure if this is a problem from Sketchup so I'm posting here to see if anyone get the same error.

@nanachi-code nanachi-code changed the title Error: #<NameError: uninitialized constant JSON::VERSION_MAJOR on Sketchup 2024 Error: #<NameError: uninitialized constant JSON::VERSION_MAJOR on Sketchup 2024.0.594 Jan 21, 2025
@Aerilius
Copy link
Owner

You are right, apparently JSON remove VERSION_MAJOR.

At the moment, I don't have access to SketchUp to test and fix the repsitory. But since you probably embed a copy of the Bridge, you could edit the code. The following should probably circumvent it:

raise(RuntimeError) unless ::JSON::VERSION.split(".")[0].to_i >= 2 or (::JSON::VERSION_MAJOR == 1 && ::JSON::VERSION_MINOR >= 6)

(parsing the major version part from the still available constant VERSION)

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