You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use “time_difference” in my ruby script, however was getting below error:
ghe_premerge_onboard.rb:47:in block in <main>': uninitialized constant TimeDifference (NameError) from ghe_premerge_onboard.rb:41:ineach'
from ghe_premerge_onboard.rb:41:in `
’
Btw,
I added following require statement in my ruby script:
require ‘time_difference’
But it throws the error for that as well? Is that correct require statement to use it in ruby script?
Also I was trying to use following way:
pom_repo.each do |repos|
commit_date = client.repository("#{orgname}/#{repos}").pushed_at
date_now = Time.now
today_date = date_now.utc
puts TimeDifference.between(commit_date, today_date).in_months
end
Please help
Thanks,
Giriraj
The text was updated successfully, but these errors were encountered:
@Giriraj24 I concur with trying out the suggestion from @Shwetakale
To make things cleaner, suggest using https://rvm.io/ and install a clean new version of Ruby
Then install the time_difference gem and require it from there and see if the problem still occur
Hi Lee,
I hope you are doing great.
I needed small help regarding: https://rubygems.org/gems/time_difference/versions/0.4.2
I was trying to use “time_difference” in my ruby script, however was getting below error:
ghe_premerge_onboard.rb:47:in
’block in <main>': uninitialized constant TimeDifference (NameError) from ghe_premerge_onboard.rb:41:in
each'from ghe_premerge_onboard.rb:41:in `
Btw,
I added following require statement in my ruby script:
require ‘time_difference’
But it throws the error for that as well? Is that correct require statement to use it in ruby script?
Also I was trying to use following way:
pom_repo.each do |repos|
commit_date = client.repository("#{orgname}/#{repos}").pushed_at
date_now = Time.now
today_date = date_now.utc
puts TimeDifference.between(commit_date, today_date).in_months
end
Please help
Thanks,
Giriraj
The text was updated successfully, but these errors were encountered: