good day i read about relativity gem but when i try to use it and make a test file and build it gives me an error =test.rb<pre> require ''relativity'' opens_at = DayTime.new(9) #=> 09:00:00 closes_at = DayTime.new(12,30) #=> 12:30:00 </pre> <pre> /home/start/.rvm/gems/ruby-1.9.2-p290/gems/relativity-0.0.8/lib/ relativity/day_time/new.rb:24:in `BigDecimal'': can''t convert Fixnum into String (TypeError) from /home/start/.rvm/gems/ruby-1.9.2-p290/gems/relativity-0.0.8/lib/ relativity/day_time/new.rb:24:in `initialize'' from /home/start/Aptana Studio 3 Workspace/jquery/javascript/test.rb: 2:in `new'' from /home/start/Aptana Studio 3 Workspace/jquery/javascript/test.rb: 2:in `<main>'' </pre> -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter Vandenabeele
2012-Mar-01 12:58 UTC
Re: can''t convert Fixnum into String in relativity
On Wed, Feb 29, 2012 at 6:42 PM, rubytalks <doejoeeventplace-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> good day i read about relativity gem but when i try to use it and make > a test file and build it gives me an error > > =test.rb> <pre> > > require ''relativity'' > opens_at = DayTime.new(9) #=> 09:00:00 > closes_at = DayTime.new(12,30) #=> 12:30:00 > </pre> > > > <pre> > /home/start/.rvm/gems/ruby-1.9.2-p290/gems/relativity-0.0.8/lib/ > relativity/day_time/new.rb:24:in `BigDecimal'': can''t convert Fixnum > into String (TypeError)Thanks for the feedback. For ruby 1.9.2 this was indeed a bug in version 0.0.8. (because BigDecimal.new() did not take Integer argument). I resolved that in version 0.0.9, so could you check please which version of relativity you are using. To update to a new version, in a gemset that I had not updated yet, I could successfully run this (did that just now): $ gem list | grep relativity relativity (0.0.8, 0.0.7, 0.0.6, 0.0.3) $ gem install relativity Fetching: relativity-0.0.9.gem (100%) Successfully installed relativity-0.0.9 1 gem installed $ irb 1.9.2p290 :001 > require ''relativity'' => true 1.9.2p290 :002 > DayTime.new => 13:56:55 Note: it will not work at al in ruby 1.8.x because I am using some newer Regexp features. Thanks, Peter -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.