save() function fails in console script
script/console <<EOF
class Context < ActiveResource::Base; end
Context.site = "http://localhost:3000/"
Context.site.user = "username"
Context.site.password = CGI.escape "password"
a = Context.find :first
a.save
EOF
Returns this error:
NoMethodError: undefined method `name' for nil:NilClass
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/whiny_nil.rb:52:in `method_missing'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/xml_mini/rexml.rb:29:in `merge_element!'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/xml_mini/rexml.rb:18:in `parse'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/xml_mini.rb:12:in `__send__'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/xml_mini.rb:12:in `parse'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/hash/conversions.rb:164:in `from_xml'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/formats/xml_format.rb:19:in `decode'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/base.rb:1092:in `load_attributes_from_response'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/base.rb:1078:in `update'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/base.rb:1077:in `tap'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/base.rb:1077:in `update'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/base.rb:867:in `save_without_validation'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/validations.rb:259:in `save'
from (irb):6
class Context < ActiveResource::Base; end
Context.site = "http://localhost:3000/"
Context.site.user = "username"
Context.site.password = CGI.escape "password"
a = Context.find :first
a.save
EOF
Returns this error:
NoMethodError: undefined method `name' for nil:NilClass
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/whiny_nil.rb:52:in `method_missing'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/xml_mini/rexml.rb:29:in `merge_element!'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/xml_mini/rexml.rb:18:in `parse'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/xml_mini.rb:12:in `__send__'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/xml_mini.rb:12:in `parse'
from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.3.14/lib/active_support/core_ext/hash/conversions.rb:164:in `from_xml'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/formats/xml_format.rb:19:in `decode'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/base.rb:1092:in `load_attributes_from_response'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/base.rb:1078:in `update'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/base.rb:1077:in `tap'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/base.rb:1077:in `update'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/base.rb:867:in `save_without_validation'
from /opt/local/lib/ruby/gems/1.8/gems/activeresource-2.3.14/lib/active_resource/validations.rb:259:in `save'
from (irb):6
Leave a comment
on 2011-09-04 18:30 *
By popsch
Status changed from Invalid to New
Status changed from Invalid to New
It's about the console script that comes with tracks. That's how it's related.
The Gemfile seems to lock activesupport to the 2.3.X version and this gives an error. Is there a way to force it to use activesupport > 3.x?
The Gemfile seems to lock activesupport to the 2.3.X version and this gives an error. Is there a way to force it to use activesupport > 3.x?
Context.all returns this error:
NoMethodError: undefined method `all' for Context:Class
from (irb):12
Regardless of this, if you think that the error message from activesupport will go away when upgrading tracks to rails 3.1 (ticket #1112), then feel free to close this one.
NoMethodError: undefined method `all' for Context:Class
from (irb):12
Regardless of this, if you think that the error message from activesupport will go away when upgrading tracks to rails 3.1 (ticket #1112), then feel free to close this one.