Hi all I am getting this problem when I run this code in server. In my localhost everything is running fine. But when I deploy my code in the server it shows me the error. I am using FERRET SERARCH IN MODEL. NameError in CompetitorsController#index uninitialized constant CompetitorsController::Competitor RAILS_ROOT: /home/troche/mrecip_tool/releases/20091219131859 Application Trace | Framework Trace | Full Trace /opt/ruby_enterprise/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:102:in `const_missing'' /home/troche/mrecip_tool/releases/20091219131859/app/controllers/competitors_controller.rb:19:in `index'' My controller is class CompetitorsController < ApplicationController include AuthenticatedSystem layout ''application'' auto_complete_for :proscribed, :competitor auto_complete_for :fee_earner, :fee_earner protect_from_forgery :only => [:tag] before_filter :login_required, :only => [:index, :show, :new, :edit] @@total_company = 70 # GET /competitors # GET /competitors.xml def index @compet = Competitor.find(:all) ### GETTING ERROR IN THIS LINE respond_to do |format| format.html # index.html.erb format.xml { render :xml => @compet } end end # GET /competitors/1 # GET /competitors/1.xml def show @competitor = Competitor.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @competitor } end end # GET /competitors/new # GET /competitors/new.xml end **************************************************************************** My Model is class Competitor < ActiveRecord::Base validates_presence_of :fee_earner_id, :notes belongs_to :fee_earner belongs_to :country belongs_to :state belongs_to :user acts_as_ferret :fields =>[:competitor, :client, :subject_matter],:remote => true end -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Sat, May 15, 2010 at 12:28 AM, Manish Nautiyal <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I am getting this problem when I run this code in server. In my > localhost everything is running fine. But when I deploy my code in the > server it shows me the error.> def index > @compet = Competitor.find(:all) ### GETTING ERROR IN THIS LINEAre you sure all your migrations have run successfully on the server? What happens if you open a console and try `Competitor.find(:all)` ? -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org twitter: @hassan -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On May 15, 9:28 am, Manish Nautiyal <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> > class Competitor < ActiveRecord::Base >Is this in app/models/competitor.rb (case is probably important) ? Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung wrote:> On May 15, 9:28�am, Manish Nautiyal <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: > >> >> class Competitor < ActiveRecord::Base >> > > Is this in app/models/competitor.rb (case is probably important) ? > > FredYes it in the app/models/competitor.rb -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder wrote:> On Sat, May 15, 2010 at 12:28 AM, Manish Nautiyal <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: > >> I am getting this problem when I run this code in server. In my >> localhost everything is running fine. But when I deploy my code in the >> server it shows me the error. > >> �def index >> � �@compet = Competitor.find(:all) � ### GETTING ERROR IN THIS LINE > > Are you sure all your migrations have run successfully on the server? > What happens if you open a console and try `Competitor.find(:all)` ? > > -- > Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org > twitter: @hassanYes Hassan all my migrations have run successfully on the server. On the server there is no console facility. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On 15 May 2010 08:28, Manish Nautiyal <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hi all > > I am getting this problem when I run this code in server. In my > localhost everything is running fine. But when I deploy my code in the > server it shows me the error. I am using FERRET SERARCH IN MODEL. > > NameError in CompetitorsController#index > > uninitialized constant CompetitorsController::Competitor > > RAILS_ROOT: /home/troche/mrecip_tool/releases/20091219131859 > Application Trace | Framework Trace | Full Trace > > /opt/ruby_enterprise/lib/ruby/gems/1.8/gems/activesupport-2.2.2/lib/active_support/dependencies.rb:102:in > `const_missing'' > /home/troche/mrecip_tool/releases/20091219131859/app/controllers/competitors_controller.rb:19:in > `index'' > > > My controller is > > class CompetitorsController < ApplicationController > > include AuthenticatedSystem > layout ''application'' > > auto_complete_for :proscribed, :competitor > auto_complete_for :fee_earner, :fee_earner > > protect_from_forgery :only => [:tag] > > before_filter :login_required, :only => [:index, :show, :new, :edit] > > @@total_company = 70 > > > # GET /competitors > # GET /competitors.xml > def index > @compet = Competitor.find(:all) ### GETTING ERROR IN THIS LINEHave you checked that there is a competitors table in the production database (perhaps you forgot to run the migrations on that db as Hassan suggested)? Also check that the file app/models/competitors.rb is present on the production server and restart the server. You have not answered Hassan''s question: What happens if you open a console and try `Competitor.find(:all)` ? (on the production server) Colin -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.