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

cannot load such file -- active_support/core_ext (LoadError) #1

Open
matecode opened this issue Feb 8, 2021 · 2 comments
Open

cannot load such file -- active_support/core_ext (LoadError) #1

matecode opened this issue Feb 8, 2021 · 2 comments

Comments

@matecode
Copy link

matecode commented Feb 8, 2021

Hi. I wanted to try you script (Mac Big Sur, ruby 3.0 installed threw homebrew) but i get the following error:

<internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- active_support/core_ext (LoadError)
	from <internal:/usr/local/Cellar/ruby/3.0.0_1/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
	from swag_gen_factory/gen_network_code.rb:2:in `<main>'

Google did not help me, maybe you can. Thx

@dev4y0u
Copy link
Contributor

dev4y0u commented Feb 22, 2021

Change first lines in the script to
require 'json'
require 'active_support'
require 'active_support/core_ext'

You have to load 'active_support' before you can use require 'active_support/core_ext'

Further I noticed that you should generate the swagger file from the "swagger code gen". I used NSwag first and got an error: "gen_network_code.rb:337:in initialize': undefined method []' for nil:NilClass (NoMethodError)" which was raised by an "invalid" generated json file.

@albertocavalcante
Copy link

@dev4y0u thanks! Could you share a sample Swagger which is working for you? I'm stuck with the nil error :/

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

3 participants