Closed gvalmon closed 10 years ago
That sure looks weird. I don't have the current version of RubyMotion installed, so I can't reproduce the issue. Maybe someone else can?
I can reproduce this in RM 2.24
.
Steps:
motion-support
projectbundle update
, etc. nonesenserake
(main)> Time.now + 1.month => 2014-04-05 11:03:53 -0400
app_delegate.rb
file and replace with the code belowrake
2014-03-05 11:04:34.587 MotionSupport[78149:80b] app_delegate.rb:7:in `test': can't convert MotionSupport::Duration into an exact number (TypeError)
from app_delegate.rb:3:in `application:didFinishLaunchingWithOptions:'
2014-03-05 11:04:34.599 MotionSupport[78149:80b] *** Terminating app due to uncaught exception 'TypeError', reason: 'app_delegate.rb:7:in `test': can't convert MotionSupport::Duration into an exact number (TypeError)
from app_delegate.rb:3:in `application:didFinishLaunchingWithOptions:''
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
test
true
end
def test
Time.now + 1.month
end
end
Same problem here
To me, this looks like it's a RubyMotion issue ... at least part of it. An expression that works in the REPL should also work in a method (given there are no locals involved, as is the case here). Maybe someone in the RubyMotion team wants to comment? @Watson1978?
Hi, guys. Indeed, this is definitely RubyMotion bug. You could track the status in http://hipbyte.myjetbrains.com/youtrack/issue/RM-475, and you could close this.
Thanks
Thanks @Watson1978! :-)
Has this been fixed? I am still getting it
$ motion --version
2.31
Strange issue, not sure if it's related with RubyMotion or MotionSupport.
When I write in motion console, it works fine:
But when I write the same in compiled method:
It raises exception:
It works fine if i write
Time.now + 1.month.to_i
This issue started from latest RubyMotion (2.23/2.24).
Do you know something about it?
Thanks.