Home > The Error > The Error Occurred While Evaluating Nil.size

The Error Occurred While Evaluating Nil.size

up vote 0 down vote favorite This is the code: xml = REXML::Document.new(data) @contacts = Array.new xml.elements.each('//entry') do |entry| person = {} person['name'] = entry.elements['title'].text gd_email = entry.elements['gd:email'] person['email'] = gd_email.attributes['address'] Pages 1 Posts [ 4 ] 1 Topic by muxstudycentre1 2010-09-22 10:28:12 muxstudycentre1 Registered: 2010-09-16 Posts: 2 Topic: rake aborted! Status:ClosedStart date:11/09/2011Priority:NormalDue date:Assignee:Patrick Otto% Done:0%Category:webSpent time:-Target version:- Keywords: Affected URL:https://github.com/nicklewis/puppet-forge/tree/10683-invalid-version Branch: We've Moved! before sorting to ensure you have no nil values in the array. check my blog

Contact information - E-Mail: webmaster (at) ruby-forum (dot) com. Report post Edit Move Delete topic Reply with quote Re: rake aborted! i think i copied that from some howto thoughtbot, inc. Owner grosser commented Jun 2, 2015 update the cucumber version in the projects Gemfile.lock and see if that breaks too, if yes you know what to fix :D ccverak commented Jun

If the element['title'] is null you'll get the error you are seeing so you'll want to either skip those elements or use a default value for the name field, like "unknown". Reload to refresh your session. The error occurred while evaluating nil.[]data{...}request#backtrace[RAILS_ROOT]/lib/release_query.rb:46:in `parse'[RAILS_ROOT]/lib/release_query.rb:5:in `initialize'[RAILS_ROOT]/app/controllers/releases_controller.rb:19:in `new'[RAILS_ROOT]/app/controllers/releases_controller.rb:19:in `find'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `send'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:1331:in `perform_action_without_filters'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:617:in `call_filters'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:610:in `perform_action_without_benchmark'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'/usr/lib/ruby/1.8/benchmark.rb:308:in `realtime'/var/lib/gems/1.8/gems/activesupport-2.3.5/lib/active_support/core_ext/benchmark.rb:17:in `ms'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/rescue.rb:160:in `perform_action_without_flash'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/flash.rb:146:in `perform_action_without_newrelic_trace'/var/lib/gems/1.8/gems/newrelic_rpm-3.3.0/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:255:in `perform_action'/var/lib/gems/1.8/gems/newrelic_rpm-3.3.0/lib/new_relic/agent/method_tracer.rb:242:in `trace_execution_scoped'/var/lib/gems/1.8/gems/newrelic_rpm-3.3.0/lib/new_relic/agent/instrumentation/controller_instrumentation.rb:248:in `perform_action'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `send'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:532:in `process_without_filters'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/filters.rb:606:in `process'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:391:in `process'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/base.rb:386:in `call'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/routing/route_set.rb:437:in `call'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:87:in `dispatch'/var/lib/gems/1.8/gems/actionpack-2.3.5/lib/action_controller/dispatcher.rb:121:in Do you have any default configuration or something that would override the source_file_options?

crop_command + super.join(' ').sub(/ -crop \S+/, '').split(' ') # super returns an array like this: ["-resize", "100x", "-crop", "100x100+0+0", "+repage"] else super end end def crop_command target = @attachment.instance if target.cropping? Powered by Redmine © 2006-2012 Jean-Philippe Lang This is an archive from Rails Forum. The error occurred while evaluating nil.name nameth (Guest) on 2008-04-24 17:03 Okay so heres my code which works fine, i'll explain the problem below. <% for num in [email protected] %>

Hello, Can you try again with the --trace option:rake db:migrate --traceand paste here the result you get. 3 Reply by muxstudycentre1 2010-09-25 09:44:28 muxstudycentre1 Registered: 2010-09-16 Posts: 2 Re: rake aborted! The error occurred while evaluating nil.name Phlip (Guest) on 2008-04-25 03:53 nameth wrote: >>> <% for num in 1... The error occurred while evaluating nil.name Barney (Guest) on 2008-04-26 13:05 nameth, You don't have to resort to old-school indexed iteration to solve this type of problem. https://github.com/grosser/parallel_tests/issues/355 The error occurred while evaluating nil.size i tried my leval best but not getting anything correct,any one can help????

If you downgrade to pre-2.0.0, it should work. Updated over 4 years ago. nir0 commented Jan 10, 2012 tamoyal, do you have any initializer up for paperclip? The error occurred while evaluating nil.name." I know that num is outputting a number because if i throw <%=num%> somewhere in the loop it will output all the numbers.

HTTP/1.1 400 Bad Request Date: Tue, 15 Nov 2011 22:18:39 GMT Server: Apache/2.2.14 (Ubuntu) X-Powered-By: Phusion Passenger (mod_rails/mod_rack) 2.2.11 X-Runtime: 9 Cache-Control: no-cache Content-Length: 47 Status: 400 Connection: close Content-Type: application/json; I would like to reopen this issue. Owner grosser commented Mar 30, 2015 can you try to fix it and make a PR, I'd suspect something in the parent class has changed, would be nice if it worked Join them; it only takes a minute: Sign up Why do I get “The error occurred while evaluating nil.<=>” when using sort_by?

You might have expected an instance of Array. http://linuxprofilm.com/the-error/the-error-occurred-while-evaluating-nil-map.html You should update your code to have that, or use Paperclip::Attachment.default_options.merge({ ... The error occurred while evaluating nil.sizei tried my leval best but not getting anything correct,any one can help???? 2 Reply by Flo23 2010-09-22 11:05:43 Flo23 From: Lima, Peru Registered: 2009-03-17 Posts: The error occurred while evaluating nil.name nameth (Guest) on 2008-04-24 18:55 Yeah i know i could just use <%for each prod in @results%> and then reference by <%=prod.name%> <%=prod.price%> etc... ,

Report post Edit Move Delete topic Reply with quote Re: Please help. Is there an image and video viewer like on smart phones in Ubuntu? You might have expected an instance of Array. news The instance variable @stories seems to be nil, or none existant when the view goes to reference it.

I'm stuck on this i've tried everything i can think of, I know there are other ways to loop through this but i need this way to work. Ruby-Forum.com Ruby Ruby Ruby on Rails JRuby Ruby Jobs About this forum Ruby-Forum Non-English Italian Ruby Group Forum: Rails deployment rake aborted! Have a look at Rails' 'grouping' extentions to Array: http://api.rubyonrails.org/classes/ActiveSupport/C...

For example, <% @results.each do |product| %> ...

This version expresses your intentions much more clearly, which will make it easier to maintain in the future..

Some people prefer the vb/c# like iteration: for result in @results do Personally I don't like that because it's one more indirection than necessary. Please click the link in the confirmation email to activate your subscription. How to deal with being asked to smile more? Posts [ 4 ] Pages 1 Rails Forum - Ruby on Rails Help and Discussion Forum 損Models and Database 損rake aborted!

The error occurred while evaluating nil.each が返ってくる。つまり、test/hoge.htmlにアクセスしたときにアクションが実行されてないという問題。試しにコントローラをイニシャライズしてみたら動く。(てことはviewを開いた瞬間にはコントローラはnewされてるのか) class TestController < ApplicationController def initialize @users = User.find(:all) end def hoge @users = User.find(:all) #この場合なくてもいい end end うまく動いてるアクションもあるから、一応イニシャライザをつけといて、うまく動いてるやつはその都度オーバーライドさせるとか?なんか不具合のもとになりそうな対症療法だ。。。このへんはRailsが使ってるRubyのメタプログラミング機能やそもそものRailsの仕様を知らないとわからないのかな。あるいはルーティングだけで解決できるのか。(追記)ビューに直接書くという方法があった。つまり、 <%= @users = User.find(:all)%> <% Already have an account? Log In I "have a nil object, when I didn't expect it" Ruby kelp 2010-06-07 21:47:09 UTC #1 I'm on page 340 in the Simply Rails book, but when I was More about the author We recommend upgrading to the latest Safari, Google Chrome, or Firefox.

Subscribed! The error occurred while evaluating nil.[] * data: rails_root/opt/forgeexceptionYou have a nil object when you didn't expect it!

<%= product.name%> | <%= number_to_currency(product.price)%>