I have a fairly sophisticated Rails app that I am trying to upgrade
from 2.1.0 to 2.3.10, and move from hobo 0.8.3 to 1.1.0-pre2.  I fixed
a number of issues before getting to this, but now I am stuck.  Here
is what I get when I try to run script/server:

$ ruby script/server
=> Booting Mongrel
=> Rails 2.3.10 application starting on http://0.0.0.0:3000
/usr/local/ruby-1.8.7-p160/lib/ruby/gems/1.8/gems/activerecord-2.3.10/
lib/active_record/base.rb:1998:in `method_missing_without_paginate':
undefined local variable or method `hobo_model' for #<Class:
0x1055cb880> (NameError)
from /app/models/foo.rb:4
...
from /config/environment.rb:22
...

>From the model:

class Foo < ActiveRecord::Base
  hobo_model
  ...
end

Just for the heck of it, I trued doing a "include Hobo::Model" at the
top of the class, before the "hobo_model" call, and I got a stack
level too deep error.  I am not sure if this is a load order issue, or
something else I am missing, but any suggestions are welcome!

My environment.rb:
========================================================================
# Be sure to restart your web server when you modify this file.

# Uncomment below to force Rails into production mode when
# you don't control web/app server and can't set it the proper way
# ENV['RAILS_ENV'] ||= 'production'

# this env is for changing the file extension string on js and css
files
# for cacheing purposes. by default the last mod time is used.
# ENV['RAILS_ASSET_ID'] ||= 'dump_cache_now'

# Specifies gem version of Rails to use when vendor/rails is not
present
RAILS_GEM_VERSION = '2.3.10' unless defined? RAILS_GEM_VERSION

# these are used in models so they need to be defined here
# so they get picked up before the models get loaded
QUESTION_TYPES = ["x"] unless defined? QUESTION_TYPES
QUESTION_TYPE_ERROR_MESSAGE = "Valid values are: x." unless defined?
QUESTION_TYPE_ERROR_MESSAGE

# Bootstrap the Rails environment, frameworks, and default
configuration
require File.join(File.dirname(__FILE__), 'boot')

Rails::Initializer.run do |config|
  config.gem 'hobo', :version => '1.1.0.pre2'
  config.gem 'feed-normalizer'
  config.gem 'ruby-hmac', :lib => 'hmac-sha1'
  config.gem 'nokogiri', :version => '>= 1.4.1'
  config.gem 'addressable', :lib => 'addressable/uri'
  config.gem 'spreadsheet'
  config.gem 'options', :version => '~> 2.1'
  config.gem 'saml-sp', :version => '~> 3.0'
  config.gem 'yui-compressor', :lib => 'yui/compressor'
  config.gem 'yajl-ruby', :lib => 'yajl'
  config.gem 'redis-namespace', :lib => 'redis/namespace', :version =>
'~> 0.4'
  config.gem 'grit'
  config.gem 'uuidtools', :version => '~> 2.1'
  config.gem 'resque', :version => '~> 1.0'
  config.gem 'resque-fairly', :version => '~> 1.0'
  config.gem 'json', :version => '~> 1.4.6'

  # Settings in config/environments/* take precedence over those
specified here

  # Only load the plugins named here, by default all plugins in vendor/
plugins are loaded
  # config.plugins = %W( exception_notification ssl_requirement )

  # Add additional load paths for your own custom dirs
  config.autoload_paths += %W(#{RAILS_ROOT}/app/analyzers
                              #{RAILS_ROOT}/app/presenters
                              #{RAILS_ROOT}/app/params_extractors
                              #{RAILS_ROOT}/app/workers
                              #{RAILS_ROOT}/customizations)

  # Force all environments to use the same logger level
  # (by default production uses :info, the others :debug)
  config.log_level = :debug

  # Your secret key for verifying cookie session data integrity.
  # If you change this key, all old sessions will become invalid!
  # Make sure the secret is at least 30 characters and all random,
  # no regular words or you'll be exposed to dictionary attacks.
  config.action_controller.session = {
    :session_key => '_some_session_id',
    :secret      => 'its_a_secret_to_everyone'
  }

  # Use SQL instead of Active Record's schema dumper when creating the
test database.
  # This is necessary if your schema can't be completely dumped by the
schema dumper,
  # like if you have constraints or database-specific column types
  config.active_record.schema_format = :sql

  # Activate observers that should always be running
  config.active_record.observers = :foo_observer, :bart_observer, ...
(many more)

  # Make Active Record use UTC-base instead of local time
  config.active_record.default_timezone = :utc

  # SMTP settings
  config.action_mailer.delivery_method = :smtp
  config.action_mailer.smtp_settings = {
    :address => "x.x.x.x",
    :port => x,
    :domain => "x.x.x.x",
  }
  config.action_mailer.default_url_options = { :host => "localhost:
3000" }

  # Turn page caching on/off by default
  # this may be overridden in specific dev, test, or prod environment
files
  config.action_controller.perform_caching = true

  # cache to local memcached
  config.cache_store = :mem_cache_store

  # tags allowed in html being cleaned up with the "sanitize" method
  config.action_view.sanitized_allowed_tags = %w(p b br a ul li ol em
strong pre)

  config.to_prepare do
    PreCacheWorker.secret = 'shh'
  end
end
========================================================================

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to