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

kuby-core (0.20.1) raise error on dotenv (3.0.1) #137

Closed
jessie19 opened this issue May 10, 2024 · 2 comments
Closed

kuby-core (0.20.1) raise error on dotenv (3.0.1) #137

jessie19 opened this issue May 10, 2024 · 2 comments

Comments

@jessie19
Copy link

jessie19 commented May 10, 2024

Issue

When we run the

bundle exec kuby -h

We got this error

error: undefined method `version' for Rails:Module

unless Gem::Requirement.new(">= 6.1").satisfied_by?(Gem::Version.new(Rails.version))

We noticed dotenv (3.0.1) make this change in this PR.

It will be helpful if you have any insights about this error at kuby-core (0.20.1) side, thanks!

@camertron
Copy link
Member

Hey @jessie19, this looks like a problem with your kuby config file. Kuby runs in the context of your bundle (via bundle exec), but doesn't require rails or load your app. That's why the Rails module doesn't respond to the version method.

I think you might be able to fix this problem by adding

require "rails/version"

at the top of your kuby.rb config file. It needs to happen before dotenv loads, wherever that may be.

@jessie19
Copy link
Author

rails/version

Hi @camertron,

Thanks for the info, we got this issue fix by adding below load before dotenv loads

require 'rails'
require 'dotenv/load'

Thanks!

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