From: Brian Candler Date: 2011-07-31T16:48:17+09:00 Subject: Re: Ruby Exponents Tony Dermont wrote in post #697257: > Thanks for all the replies. I just can't figure it out. I placed the > same set code in just a ruby file and it runs fine, but when I have it > inside a rails model it crashed with this crash message on my browser. > If I put in an integer value for the exponent, it does not crash. > > app/models/trade.rb:137:in `**' > app/models/trade.rb:137:in `calculate_cagr' > app/views/adminportfolio/ajax_disport.rhtml:96:in > `_run_erb_47app47views47adminportfolio47ajax_disport46rhtml' > app/views/adminportfolio/ajax_disport.rhtml:69:in `each' > app/views/adminportfolio/ajax_disport.rhtml:69:in > `_run_erb_47app47views47adminportfolio47ajax_disport46rhtml' > app/views/adminportfolio/ajax_disport.rhtml:67:in > `_run_erb_47app47views47adminportfolio47ajax_disport46rhtml' > > This might be a rails issue, but if anyone can help me out I'd truly > truly appreciate it. * Show line 137 of app/models/trade.rb, plus a few lines either side. * Show the contents of the expressions you are combining. e.g. $stderr.puts foo.inspect $stderr.puts bar.inspect baz = bar ** foo -- Posted via http://www.ruby-forum.com/.