Enrico Teotti
2005-Mar-26 15:16 UTC
after a gem &rails update I get "allocator undefined for Float"
Hi, I''ve downloaded a new gem version (1.8) and I''ve gem install rails... now it''s 0.11 Now I''ve started webrick or the old project. ruby script/server I get this error: allocator undefined for Float when I try to .save an object with a float parameter... I''m using postgresql 8.0.0 Do I need to change something in my files when I upgrade rails? Thanks for the suggestions, Enrico ps this is the frameworktrace /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1040:in `clone'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1040:in `attributes'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in `inject'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in `each'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in `inject'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in `attributes'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1249:in `attributes_with_quotes'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1341:in `quoted_column_names'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1110:in `create_without_callbacks'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/callbacks.rb:264:in `create_without_timestamps'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/timestamp.rb:29:in `create'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1092:in `create_or_update_without_callbacks'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/callbacks.rb:252:in `create_or_update'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:925:in `save_without_validation'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/validations.rb:562:in `save_without_transactions'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:121:in `save'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:121:in `transaction'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:87:in `transaction'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:113:in `transaction'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:121:in `save'' /opt/ruby/contabiliteoCartoplast/app/controllers/bolle_controller.rb:145:in `corpo'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:691:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:691:in `perform_action_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/filters.rb:294:in `perform_action_without_benchmark'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in `measure'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/rescue.rb:79:in `perform_action'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:323:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:323:in `process'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:266:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/dispatcher.rb:32:in `dispatch'' /opt/ruby/contabiliteoCartoplast/public/dispatch.rb:10 /usr/lib/ruby/gems/1.8/gems/activesupport-1.0.2/lib/active_support/dependencies.rb:189:in `load'' /usr/lib/ruby/gems/1.8/gems/activesupport-1.0.2/lib/active_support/dependencies.rb:189:in `load'' /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb:84:in `handle_dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb:35:in `do_POST'' /usr/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__'' /usr/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `service'' /usr/lib/ruby/1.8/webrick/httpserver.rb:92:in `service'' /usr/lib/ruby/1.8/webrick/httpserver.rb:54:in `run'' /usr/lib/ruby/1.8/webrick/server.rb:150:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb:21:in `dispatch'' -- "The only thing necessary for the triumph of evil is for good men to do nothing" Edmund Burke
Matthew Thill
2005-Mar-26 16:35 UTC
Re: after a gem &rails update I get "allocator undefined for Float"
On the weblog at www.rubyonrails.com, there is this comment on the release of 0.11, right near the bottom: (http://weblog.rubyonrails.com/archives/2005/03/22/rails-0110-ajax-pagination-non-vhost-incoming-mail/#comments) Updating: If you’re coming from Rails 0.10.1, just run rails . --skip in the root of your application to get the new files. You shouldn’t need to change any code. You will need to clear out all your sessions, though, because of the Flash module upgrade! However, if you are coming from a version older than 0.10.1, I think you need to change to your application base directory and run rails . without the --skip. As it asks you about overwritting files, say yes to everything except ''application.rb'' and ''database.yml''. This was the advice on upgrading from 0.9.x to 0.10.x, so it should work when going from 0.9.x to 0.11 I hope this works for you. I''m just learning this stuff as well. Glad you figured out your validation problem. I didn''t know about ''validates_numericality_of'' either, but I have now read about it and it really does a regular expression validation for you, so my regular expression suggestion wasn''t totally off-base. See this page for a description of what validates_numericality_of really does: http://rails.rubyonrails.com/classes/ActiveRecord/Validations/ClassMethods.html#M000568 Enrico Teotti wrote:> Hi, > I''ve downloaded a new gem version (1.8) and I''ve gem install rails... > now it''s 0.11 > > Now I''ve started webrick or the old project. ruby script/server I get > this error: > allocator undefined for Float > when I try to .save an object with a float parameter... I''m using > postgresql 8.0.0 > > Do I need to change something in my files when I upgrade rails? > > Thanks for the suggestions, > Enrico > > ps > this is the frameworktrace > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1040:in > `clone'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1040:in > `attributes'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in > `inject'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in > `each'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in > `inject'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in > `attributes'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1249:in > `attributes_with_quotes'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1341:in > `quoted_column_names'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1110:in > `create_without_callbacks'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/callbacks.rb:264:in > `create_without_timestamps'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/timestamp.rb:29:in > `create'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1092:in > `create_or_update_without_callbacks'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/callbacks.rb:252:in > `create_or_update'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:925:in > `save_without_validation'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/validations.rb:562:in > `save_without_transactions'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:121:in > `save'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:121:in > `transaction'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:87:in > `transaction'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:113:in > `transaction'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:121:in > `save'' > /opt/ruby/contabiliteoCartoplast/app/controllers/bolle_controller.rb:145:in > `corpo'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:691:in > `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:691:in > `perform_action_without_filters'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/filters.rb:294:in > `perform_action_without_benchmark'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in > `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in > `measure'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in > `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/rescue.rb:79:in > `perform_action'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:323:in > `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:323:in > `process'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:266:in > `process'' > /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/dispatcher.rb:32:in `dispatch'' > /opt/ruby/contabiliteoCartoplast/public/dispatch.rb:10 > /usr/lib/ruby/gems/1.8/gems/activesupport-1.0.2/lib/active_support/dependencies.rb:189:in > `load'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.0.2/lib/active_support/dependencies.rb:189:in > `load'' > /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb:84:in > `handle_dispatch'' > /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb:35:in `do_POST'' > /usr/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__'' > /usr/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `service'' > /usr/lib/ruby/1.8/webrick/httpserver.rb:92:in `service'' > /usr/lib/ruby/1.8/webrick/httpserver.rb:54:in `run'' > /usr/lib/ruby/1.8/webrick/server.rb:150:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' > /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb:21:in `dispatch'' >
Enrico Teotti
2005-Mar-26 17:09 UTC
Re: after a gem &rails update I get "allocator undefined for Float"
Hi, I''ve tried rails . in the application directory but without results I still get the error... And I''ve installed rails on a brand new PC, installed postgres, recovered the db backup and created a brand new rails application. I''ve created a model connecting to a table (with a postgresql numeric type column), and a controller with scaffold to handle the insert. When I insert or edit something I get the error.... thanks for your help -- "The only thing necessary for the triumph of evil is for good men to do nothing" Edmund Burke
Chris McGrath
2005-Mar-27 01:58 UTC
Re: after a gem &rails update I get "allocator undefined for Float"
There''s some tickets on trac that might may be relevant to this problem. Somone else on irc had this problem, though they worked round it by making the field a char. http://dev.rubyonrails.com/ticket/808 http://dev.rubyonrails.com/ticket/827 Cheers, Chris On Sat, 26 Mar 2005 16:16:03 +0100, Enrico Teotti <agenteo-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > I''ve downloaded a new gem version (1.8) and I''ve gem install rails... > now it''s 0.11 > > Now I''ve started webrick or the old project. ruby script/server I get > this error: > allocator undefined for Float > when I try to .save an object with a float parameter... I''m using > postgresql 8.0.0 > > Do I need to change something in my files when I upgrade rails? > > Thanks for the suggestions, > Enrico > > ps > this is the frameworktrace > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1040:in > `clone'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1040:in > `attributes'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in > `inject'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in > `each'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in > `inject'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1038:in > `attributes'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1249:in > `attributes_with_quotes'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1341:in > `quoted_column_names'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1110:in > `create_without_callbacks'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/callbacks.rb:264:in > `create_without_timestamps'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/timestamp.rb:29:in > `create'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:1092:in > `create_or_update_without_callbacks'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/callbacks.rb:252:in > `create_or_update'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/base.rb:925:in > `save_without_validation'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/validations.rb:562:in > `save_without_transactions'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:121:in > `save'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:121:in > `transaction'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:87:in > `transaction'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:113:in > `transaction'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.9.0/lib/active_record/transactions.rb:121:in > `save'' > /opt/ruby/contabiliteoCartoplast/app/controllers/bolle_controller.rb:145:in > `corpo'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:691:in > `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:691:in > `perform_action_without_filters'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/filters.rb:294:in > `perform_action_without_benchmark'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in > `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in > `measure'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/benchmarking.rb:30:in > `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/rescue.rb:79:in > `perform_action'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:323:in > `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:323:in > `process'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.6.0/lib/action_controller/base.rb:266:in > `process'' > /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/dispatcher.rb:32:in `dispatch'' > /opt/ruby/contabiliteoCartoplast/public/dispatch.rb:10 > /usr/lib/ruby/gems/1.8/gems/activesupport-1.0.2/lib/active_support/dependencies.rb:189:in > `load'' > /usr/lib/ruby/gems/1.8/gems/activesupport-1.0.2/lib/active_support/dependencies.rb:189:in > `load'' > /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb:84:in > `handle_dispatch'' > /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb:35:in `do_POST'' > /usr/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `__send__'' > /usr/lib/ruby/1.8/webrick/httpservlet/abstract.rb:35:in `service'' > /usr/lib/ruby/1.8/webrick/httpserver.rb:92:in `service'' > /usr/lib/ruby/1.8/webrick/httpserver.rb:54:in `run'' > /usr/lib/ruby/1.8/webrick/server.rb:150:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' > /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > /usr/lib/ruby/gems/1.8/gems/rails-0.11.0/lib/webrick_server.rb:21:in `dispatch'' > > -- > "The only thing necessary for the triumph of evil > is for good men to do nothing" > Edmund Burke > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Enrico Teotti
2005-Mar-30 16:15 UTC
Re: after a gem &rails update I get "allocator undefined for Float"
I don''t know exactly how or when but the problem is solved... this morning I''ve simply re-do rails . in the app directory... and the access to Postgresql numeric values it''s ok thanks for the help Enrico -- "The only thing necessary for the triumph of evil is for good men to do nothing" Edmund Burke