ruby-core@ruby-lang.org archive (unofficial mirror)
 help / color / mirror / Atom feed
* [ruby-core:67695] [ruby-trunk - Bug #10758] [Open] undefined method `year' for nil:NilClass
       [not found] <redmine.issue-10758.20150120093734@ruby-lang.org>
@ 2015-01-20  9:37 ` rohan_daxini
  2015-01-20 11:28 ` [ruby-core:67696] [ruby-trunk - Bug #10758] " hanmac
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: rohan_daxini @ 2015-01-20  9:37 UTC (permalink / raw
  To: ruby-core

Issue #10758 has been reported by Rohan Daxini.

----------------------------------------
Bug #10758: undefined method `year' for nil:NilClass
https://bugs.ruby-lang.org/issues/10758

* Author: Rohan Daxini
* Status: Open
* Priority: High
* Assignee: 
* ruby -v: 2.2.0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I am facing this error only in Ruby 2.2.0 as I recently upgraded to latest Ruby 2.2.0

Here is the console log

2.2.0 :008 > Time.zone.parse("2014-12-29 20:16:32 -0400")
NoMethodError: undefined method `year' for nil:NilClass
	from /.rvm/gems/ruby-2.2.0/gems/activesupport-3.2.18/lib/active_support/values/time_zone.rb:275:in `parse'
	from (irb):8
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:47:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:8:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands.rb:41:in `<top (required)>'


Whereas same works fine in Ruby 2.1.2
2.1.2 :001 > Time.zone.parse("2014-12-29 20:16:32 -0400")
 => Tue, 30 Dec 2014 00:16:32 UTC +00:00

Am I doing something wrong here? Do I need to use any other gem to make this work. Some 700 specs fail for my project after upgrading to Ruby 2.2.0 due to this undefined method 'year' errors.

Would highly appreciate your immediate help in this regard. Thanks in advance.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:67696] [ruby-trunk - Bug #10758] undefined method `year' for nil:NilClass
       [not found] <redmine.issue-10758.20150120093734@ruby-lang.org>
  2015-01-20  9:37 ` [ruby-core:67695] [ruby-trunk - Bug #10758] [Open] undefined method `year' for nil:NilClass rohan_daxini
@ 2015-01-20 11:28 ` hanmac
  2015-01-20 13:21 ` [ruby-core:67697] [ruby-trunk - Bug #10758] [Third Party's Issue] " shibata.hiroshi
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: hanmac @ 2015-01-20 11:28 UTC (permalink / raw
  To: ruby-core

Issue #10758 has been updated by Hans Mackowiak.


try to use newer activesupport version, it seems to be fixed in newer versions

----------------------------------------
Bug #10758: undefined method `year' for nil:NilClass
https://bugs.ruby-lang.org/issues/10758#change-51133

* Author: Rohan Daxini
* Status: Open
* Priority: High
* Assignee: 
* ruby -v: 2.2.0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I am facing this error only in Ruby 2.2.0 as I recently upgraded to latest Ruby 2.2.0

Here is the console log

2.2.0 :008 > Time.zone.parse("2014-12-29 20:16:32 -0400")
NoMethodError: undefined method `year' for nil:NilClass
	from /.rvm/gems/ruby-2.2.0/gems/activesupport-3.2.18/lib/active_support/values/time_zone.rb:275:in `parse'
	from (irb):8
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:47:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:8:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands.rb:41:in `<top (required)>'


Whereas same works fine in Ruby 2.1.2
2.1.2 :001 > Time.zone.parse("2014-12-29 20:16:32 -0400")
 => Tue, 30 Dec 2014 00:16:32 UTC +00:00

Am I doing something wrong here? Do I need to use any other gem to make this work. Some 700 specs fail for my project after upgrading to Ruby 2.2.0 due to this undefined method 'year' errors.

Would highly appreciate your immediate help in this regard. Thanks in advance.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:67697] [ruby-trunk - Bug #10758] [Third Party's Issue] undefined method `year' for nil:NilClass
       [not found] <redmine.issue-10758.20150120093734@ruby-lang.org>
  2015-01-20  9:37 ` [ruby-core:67695] [ruby-trunk - Bug #10758] [Open] undefined method `year' for nil:NilClass rohan_daxini
  2015-01-20 11:28 ` [ruby-core:67696] [ruby-trunk - Bug #10758] " hanmac
@ 2015-01-20 13:21 ` shibata.hiroshi
  2015-01-20 13:26 ` [ruby-core:67699] [ruby-trunk - Bug #10758] " rohan_daxini
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 6+ messages in thread
From: shibata.hiroshi @ 2015-01-20 13:21 UTC (permalink / raw
  To: ruby-core

Issue #10758 has been updated by Hiroshi SHIBATA.

Status changed from Open to Third Party's Issue

You should report rails/rails repository in github at first

----------------------------------------
Bug #10758: undefined method `year' for nil:NilClass
https://bugs.ruby-lang.org/issues/10758#change-51134

* Author: Rohan Daxini
* Status: Third Party's Issue
* Priority: High
* Assignee: 
* ruby -v: 2.2.0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I am facing this error only in Ruby 2.2.0 as I recently upgraded to latest Ruby 2.2.0

Here is the console log

2.2.0 :008 > Time.zone.parse("2014-12-29 20:16:32 -0400")
NoMethodError: undefined method `year' for nil:NilClass
	from /.rvm/gems/ruby-2.2.0/gems/activesupport-3.2.18/lib/active_support/values/time_zone.rb:275:in `parse'
	from (irb):8
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:47:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:8:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands.rb:41:in `<top (required)>'


Whereas same works fine in Ruby 2.1.2
2.1.2 :001 > Time.zone.parse("2014-12-29 20:16:32 -0400")
 => Tue, 30 Dec 2014 00:16:32 UTC +00:00

Am I doing something wrong here? Do I need to use any other gem to make this work. Some 700 specs fail for my project after upgrading to Ruby 2.2.0 due to this undefined method 'year' errors.

Would highly appreciate your immediate help in this regard. Thanks in advance.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:67699] [ruby-trunk - Bug #10758] undefined method `year' for nil:NilClass
       [not found] <redmine.issue-10758.20150120093734@ruby-lang.org>
                   ` (2 preceding siblings ...)
  2015-01-20 13:21 ` [ruby-core:67697] [ruby-trunk - Bug #10758] [Third Party's Issue] " shibata.hiroshi
@ 2015-01-20 13:26 ` rohan_daxini
  2015-01-24 23:48 ` [ruby-core:67798] " johnbolliger
  2015-01-25  0:14 ` [ruby-core:67799] " nobu
  5 siblings, 0 replies; 6+ messages in thread
From: rohan_daxini @ 2015-01-20 13:26 UTC (permalink / raw
  To: ruby-core

Issue #10758 has been updated by Rohan Daxini.


Hiroshi SHIBATA wrote:
> You should report rails/rails repository in github at first

Sorry but I did not know this is Rails issue. As the same code works fine on Ruby 2.1.2 but throws error on Ruby 2.2.0 despite keeping same Active record.

----------------------------------------
Bug #10758: undefined method `year' for nil:NilClass
https://bugs.ruby-lang.org/issues/10758#change-51136

* Author: Rohan Daxini
* Status: Third Party's Issue
* Priority: High
* Assignee: 
* ruby -v: 2.2.0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I am facing this error only in Ruby 2.2.0 as I recently upgraded to latest Ruby 2.2.0

Here is the console log

2.2.0 :008 > Time.zone.parse("2014-12-29 20:16:32 -0400")
NoMethodError: undefined method `year' for nil:NilClass
	from /.rvm/gems/ruby-2.2.0/gems/activesupport-3.2.18/lib/active_support/values/time_zone.rb:275:in `parse'
	from (irb):8
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:47:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:8:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands.rb:41:in `<top (required)>'


Whereas same works fine in Ruby 2.1.2
2.1.2 :001 > Time.zone.parse("2014-12-29 20:16:32 -0400")
 => Tue, 30 Dec 2014 00:16:32 UTC +00:00

Am I doing something wrong here? Do I need to use any other gem to make this work. Some 700 specs fail for my project after upgrading to Ruby 2.2.0 due to this undefined method 'year' errors.

Would highly appreciate your immediate help in this regard. Thanks in advance.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:67798] [ruby-trunk - Bug #10758] undefined method `year' for nil:NilClass
       [not found] <redmine.issue-10758.20150120093734@ruby-lang.org>
                   ` (3 preceding siblings ...)
  2015-01-20 13:26 ` [ruby-core:67699] [ruby-trunk - Bug #10758] " rohan_daxini
@ 2015-01-24 23:48 ` johnbolliger
  2015-01-25  0:14 ` [ruby-core:67799] " nobu
  5 siblings, 0 replies; 6+ messages in thread
From: johnbolliger @ 2015-01-24 23:48 UTC (permalink / raw
  To: ruby-core

Issue #10758 has been updated by John Bolliger.


Could the behavior of the following code have changed between Ruby 2.1.2 and Ruby 2.2.0? 

In the Rails 3.2.21 with Ruby 2.1.2 version of activesupport the following works:

         def parse(str, now=now)

With Ruby 2.2.0 it no longer works. In the latest version of activesupport on master on github that line has changed to the following:

        def parse(str, now=now())

With 2.2.0 is it now necessary to use the () when referencing a function with the same name a default value assignment?

----------------------------------------
Bug #10758: undefined method `year' for nil:NilClass
https://bugs.ruby-lang.org/issues/10758#change-51209

* Author: Rohan Daxini
* Status: Third Party's Issue
* Priority: High
* Assignee: 
* ruby -v: 2.2.0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I am facing this error only in Ruby 2.2.0 as I recently upgraded to latest Ruby 2.2.0

Here is the console log

2.2.0 :008 > Time.zone.parse("2014-12-29 20:16:32 -0400")
NoMethodError: undefined method `year' for nil:NilClass
	from /.rvm/gems/ruby-2.2.0/gems/activesupport-3.2.18/lib/active_support/values/time_zone.rb:275:in `parse'
	from (irb):8
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:47:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:8:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands.rb:41:in `<top (required)>'


Whereas same works fine in Ruby 2.1.2
2.1.2 :001 > Time.zone.parse("2014-12-29 20:16:32 -0400")
 => Tue, 30 Dec 2014 00:16:32 UTC +00:00

Am I doing something wrong here? Do I need to use any other gem to make this work. Some 700 specs fail for my project after upgrading to Ruby 2.2.0 due to this undefined method 'year' errors.

Would highly appreciate your immediate help in this regard. Thanks in advance.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ruby-core:67799] [ruby-trunk - Bug #10758] undefined method `year' for nil:NilClass
       [not found] <redmine.issue-10758.20150120093734@ruby-lang.org>
                   ` (4 preceding siblings ...)
  2015-01-24 23:48 ` [ruby-core:67798] " johnbolliger
@ 2015-01-25  0:14 ` nobu
  5 siblings, 0 replies; 6+ messages in thread
From: nobu @ 2015-01-25  0:14 UTC (permalink / raw
  To: ruby-core

Issue #10758 has been updated by Nobuyoshi Nakada.

Description updated

From NEWS in 2.2.0

---
== Changes since the 2.1.0 release

=== Language changes

* default argument
  fixed a very longstanding bug that an optional argument was not
  accessible in its default value expression.  [Bug #9593]


----------------------------------------
Bug #10758: undefined method `year' for nil:NilClass
https://bugs.ruby-lang.org/issues/10758#change-51210

* Author: Rohan Daxini
* Status: Third Party's Issue
* Priority: High
* Assignee: 
* ruby -v: 2.2.0
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN, 2.2: UNKNOWN
----------------------------------------
I am facing this error only in Ruby 2.2.0 as I recently upgraded to latest Ruby 2.2.0

Here is the console log

~~~
2.2.0 :008 > Time.zone.parse("2014-12-29 20:16:32 -0400")
NoMethodError: undefined method `year' for nil:NilClass
	from /.rvm/gems/ruby-2.2.0/gems/activesupport-3.2.18/lib/active_support/values/time_zone.rb:275:in `parse'
	from (irb):8
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:47:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands/console.rb:8:in `start'
	from /.rvm/gems/ruby-2.2.0/gems/railties-3.2.18/lib/rails/commands.rb:41:in `<top (required)>'
~~~

Whereas same works fine in Ruby 2.1.2

~~~
2.1.2 :001 > Time.zone.parse("2014-12-29 20:16:32 -0400")
 => Tue, 30 Dec 2014 00:16:32 UTC +00:00
~~~

Am I doing something wrong here? Do I need to use any other gem to make this work. Some 700 specs fail for my project after upgrading to Ruby 2.2.0 due to this undefined method 'year' errors.

Would highly appreciate your immediate help in this regard. Thanks in advance.



-- 
https://bugs.ruby-lang.org/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-01-25  0:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <redmine.issue-10758.20150120093734@ruby-lang.org>
2015-01-20  9:37 ` [ruby-core:67695] [ruby-trunk - Bug #10758] [Open] undefined method `year' for nil:NilClass rohan_daxini
2015-01-20 11:28 ` [ruby-core:67696] [ruby-trunk - Bug #10758] " hanmac
2015-01-20 13:21 ` [ruby-core:67697] [ruby-trunk - Bug #10758] [Third Party's Issue] " shibata.hiroshi
2015-01-20 13:26 ` [ruby-core:67699] [ruby-trunk - Bug #10758] " rohan_daxini
2015-01-24 23:48 ` [ruby-core:67798] " johnbolliger
2015-01-25  0:14 ` [ruby-core:67799] " nobu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).