search for: nomethoderror

Displaying 20 results from an estimated 1219 matches for "nomethoderror".

2009 Feb 10
2
rescue_from for NoMethodError
Hi everyone, I was just trying to catch some exceptions in my app, for "Record Not Found" I used this in my application.rb file rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found rescue_from ActionController::NoMethodError, :with => :show_error private def record_not_found render :text => "404 Not Found", :status => 404 end def show_error(exception) render :text => exception.message; end and was quite successful but for "NoMethodError" I am trying the same but It is...
2009 Oct 18
4
NoMethodError in User sessionsController#new
...39;'m setting up authentication with Authlogic and I get this error. I''ve done some searching but with no success. I tried setting the current_user method in Application_controller to protected and not private, on the recommendation in Stack Overflow. Error in browser----------------- NoMethodError in User sessionsController#new undefined method `require_no_user'' for #<UserSessionsController: 0x24fc700> Error in terminal------------------ Processing UserSessionsController#new (for 127.0.0.1 at 2009-10-17 23:26:38) [GET] Parameters: {"action"=>"new",...
2009 Nov 12
3
Got NoMethodError on Model's find method.
Hi All, I don''t know how this could happen. I got NoMethodError on running a simple Model''s find method. At first i have the same error for running find_all_by_country method where country is one of the model''s attributes. So, running a find method also doesn''t help. I have no problem running the methods on rails console. What should...
2007 May 26
11
RSpec
...30-07:~/desktop/restful_auth_rspec multimedia$ rake spec (in /Users/multimedia/Desktop/restful_auth_rspec) /Users/multimedia/Desktop/restful_auth_rspec/config/../vendor/plugins/trunk/railties/lib/dispatcher.rb:90: undefined method `attr_accessor_with_default'' for #<Class:Dispatcher> (NoMethodError) from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'' from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `require'' from /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/d...
2006 Jul 08
2
NoMethodError in Recipe#index
I''m trying to teach myself Ruby on Rails, and doing the infamous Cookbook as a starting point. I''m all set until the point when I go to create of sumbit my recipe and I get this error: NoMethodError in Recipe#index You have a nil object when you didn''t expect it! The error occured while evaluating nil.name 15: <% @recipes.each do |recipe| %> 16: <tr> 17: <td><%= link_to recipe.title, :action => "show", :id => recipe.id %></td> 18:...
2007 Oct 15
3
NoMethodError
Hi to all!! I am new to ruby. I am trying to write a program to fetch the data from Database and written the data using pagination. I could get the data from DB. but pagination is not working. When i see the log file it is showing the following error. NoMethodError: undefined method ''paginatior'' #<Hash...> my pginate.rb and pagination.rb files are not in the same folder Here is my piece of code: def sample_method sql = "select * from customers where rownum < 100" collection = Sample::Models::Sa::Customer.find_by_sql...
2007 May 27
3
[NoMethodError] simple problem
I think this test should pass but it doesn''t 1) NoMethodError in ''Person should return full name'' undefined method `full_name?'' for #<Person:0x3567964> ./spec/models/person_spec.rb:43: describe Person do it "should return full name" do person = Person.new person.should be_full_name end end class Person &...
2006 Jun 22
1
acts_as_taggable gem problems
...End tags/list.rb: <ul> <% @tags.each do |t| %> <li><%= t.freq %> <%= t.name %></li> <% end %> </ul> According to the acts_as_taggable gem rdocs (ActiveRecord::Acts::Taggable::ClassMethods) I should be using Issues.tags_count, but I get a NoMethodError. Any ideas? This doesn''twork in the console either. (I''ve since opened up taggable.rb and taken a look at the sql involved. I have figured out the sql to do this in MS SQLserver to give me the correct results, but this still doesn''t solve the NoMethodError) 2. I...
2006 Aug 14
1
NoMethodError
...antity %></td> <td><%= h(product.title)%></td> <td align="right"><%=item.unit_price %></td> <td align="right"><%=item.unit_price * item.quantity %></td> </tr> <% end %> </table> I saw this message NoMethodError in Store#display_cart Showing app/views/store/display_cart.rhtml where line #5 raised: undefined method `product'' for 5.0:Float Extracted source (around line #5): 2: <table> 3: <% 4: for item in @items 5: product = item.product 6: %> 7: <tr> 8: <td><%= item.q...
2008 Jun 06
2
`exit?'': undefined method `run?'' for Test::Unit:Module (NoMethodError)?
...rom command line with executing blah_spec.rb? If I run with spec bla blah blah_spec.rb then it''s fine. . Finished in 0.264 seconds 1 example, 0 failures c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.1.4/lib/spec.rb:27:in `exit?'': undefined method `run?'' for Test::Unit:Module (NoMethodError) from c:/ruby/lib/ruby/gems/1.8/gems/rspec-1.1.4/lib/spec/runner.rb:193:in `register_at_exit_hook'' from C:/projects/xpstuff/watir/src/list_sitt.rb:3 -- View this message in context: http://www.nabble.com/%60exit-%27%3A-undefined-method-%60run-%27-for-Test%3A%3AUnit%3AModu...
2006 May 07
0
NoMethodError trying to get ApplicationHelper method from a functional test
...the includes I suspect. In the book, it states that runtime environment will load the directories app, app/models, app/controllers, app/helpers, app/apis, components, config, lib, vendor and vendor/rails/*. However, when I try to access my "current_project" public method, it fails with a NoMethodError. What is even stranger is that I can use reflection to find that the method is indeed there. For instance, this code: def test_should_login_and_redirect ApplicationHelper.public_instance_methods.each do |method| if method == "current_project" puts "calling &quot...
2006 Apr 21
2
NoMethodError with test_read_with_hash
While running the product_test.rb test fixture in the Agile Web Development book (p. 148), but when I run ruby test/unit/product_test.rb, I get the following error: 1) Error: test_read_with_hash(ProductTest): NoMethodError: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.[] test/unit/product_test.rb:39:in `test_read_with_hash'' 4 tests, 15 assertions, 0 failures, 1 errors Below is my code for the the method:...
2006 Apr 27
2
NoMethodError - why?
Getting this error when hitting update. NoMethodError in Article#update You have a nil object when you didn''t expect it! You might have expected an instance of ActiveRecord::Base. The error occured while evaluating nil.update_attributes Source code. def create @article = Article.new(params[:article]) @article.user = @session['...
2006 Jan 11
1
Keep ketting weird error, NoMethodError in Admin#create_survey Keep getting ''undefined method `assign_variables_from_controller'' for #<Survey:0xb7462244>''
Hi list, I keep getting the following error: NoMethodError in Admin#create_survey undefined method `assign_variables_from_controller'' for #<Survey:0xb7462244> contents of Admin#create_survey is: @template = Survey.find(params[''survey''][''id'']) render :layout => false I have no idea where this com...
2006 Jan 21
1
HELP: NoMethodError (undefined method `stringify_keys!'' for
We have a flash developer who is intergating with a rails application when he posts a particular variable (in this case ''rating'') We get a ''Rails Application Error'' Trawling the production log turns up this error; NoMethodError (undefined method `stringify_keys!'' for "10":String): The html wireframe has no such problem. A select box is used to submit the data in the style of. rating[rating] Here is the ''def'' in the controller; def rate dream = User.find(params[:id]) rating...
2005 Nov 22
1
Ferret NoMethodError
...t; include Ferret => Object irb(main):003:0> index = Index::Index.new => #<Ferret::Index::Index:0x3477ba8 @qp=nil, ...> irb(main):004:0> index << "This is a new doc" => nil irb(main):005:0> index.search_each(''*:this'') do |d, s| puts d end NoMethodError: undefined method `weight'' for nil:NilClass from c:/ruby/lib/ruby/gems/1.8/gems/ferret-0.2.2/lib/ferret/search/index_searcher.rb:104:in `search'' from c:/ruby/lib/ruby/gems/1.8/gems/ferret-0.2.2/lib/ferret/index/index.rb:588:in `do_search '' from c:/...
2012 Jan 15
1
NoMethodError: undefined method `expect'
...90 :002 > require ''rspec'' => true ruby-1.9.2-p290 :003 > RSpec::Version::STRING => "2.8.0" ruby-1.9.2-p290 :004 > describe ''division by zero'' do ruby-1.9.2-p290 :005 > expect { 2/0 }.to raise_error ruby-1.9.2-p290 :006?> end NoMethodError: undefined method `expect'' for #<Class:0x007fe272270590> from (irb):5:in `block in irb_binding'' from .../.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib/rspec/core/example_group.rb:201:in `module_eval'' from .../.rvm/gems/ruby-1.9.2-p290/gems/rspec-core-2.8.0/lib...
2007 Jan 03
0
NoMethodError when using Breakpoint
When I put something like: breakpoint["here is the place"] in my code (say, in the controller), the breakpointer will run correctly. But after I exit out of the breakpointer, the browser gets a "NoMethodError" saying: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.[] This happens even if there''s no array in the controller. If I take the breakpoint out of the code, the program runs fine. What...
2008 Nov 28
1
Rails Beginner.. NoMethodError
Dear all I encounter error when I login my Web application NoMethodError in AdminController#login undefined method `get_title'' for #<Class:0x63ac78> Here is part of my code controller/admin_controller.rb def login session[:user_id] = nil if request.post? if User.authenticate(params[:name], params[:password]) user = User.find_by_na...
2009 May 29
1
tests problem - NoMethodError: private method `gsub' called for 117681882:Fixnum
Hi, i got very strange problem connected to tests in Rails. I got the same application code version as my team has, and on their computer all tests pass, and on my laptop (debian 5, ruby 1.8.6/1.8.7 (tried both), rails 2.3.2) i got more then 50 errors - majority of them is variations of "NoMethodError: private method `gsub'' called for 117681882:Fixnum" error in controller. Anyone know how to fix it/has this problem before? I reinstalled ruby and rails about three times, clearing gems etc every time but with no effect...