SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Errors while migrating a Rails 1.2.6 project

    I have a client that is losing his hosting account in a few days when his hosting company shuts down. I now have to do a speedy migration of their Rails 1.2.6 site to a new host (Blue Host), but I can't even get the site to run on my development server. The current roadblock is that I keep getting an error about an undefined constant, but looking at the source code it's actually coming from a model that is based on another model, and the constant name in the error is the name of the parent model. Is there something I need to do to make sure this parent model gets pre-loaded or so that Rails can find it? It's in the models directory along with the child model.

    Also, is there any way to tell which gems are required in a Rails 1.2.6 project?
    Chris Bloom
    Web Application Developer

  2. #2
    SitePoint Enthusiast
    Join Date
    Jul 2010
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow... Rails 1.2.6? Your best bet is to freeze that version of rails into the vendor directory and run directly off of that on your new server.
    Look up rails:freeze and rails:freeze:gems.

    Hopefully whatever version of Ruby Bluehost runs is compatible with that version of Rails(Ruby 1.9.2 is known to be incompatible with some earlier versions of Rails). If necessary, you may have to temporarily spring for a VPS and setup the necessary environment until you can update the app.

  3. #3
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've already got the rails 1.2.6 gems installed into our BlueHost account, but freezing them is probably a good idea too.

    Any idea why Rails can't find this model file though? That's what's really killing me right now.
    Chris Bloom
    Web Application Developer

  4. #4
    SitePoint Zealot
    Join Date
    May 2003
    Location
    Sarasota, FL
    Posts
    196
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was finally able to freeze the rails 1.2.6 gems after fighting through some additional errors, but I'm, still getting the same error that I was originally. Basically there is a model named Tag that is a descendant of UserLogging

    Code Ruby:
    # models/tag.rb
    class Tag < UserLogging
      # ...
    end
     
    # models/user_logging.rb
    class UserLogging < ActiveRecord::Base
      # ...
    end

    Anytime I try to start the server or the console I get the following trace:

    Code:
    /my_app/vendor/rails/activesupport/lib/active_support/dependencies.rb:266:in `load_missing_constant':NameError: uninitialized constant UserLogging
    /my_app/vendor/rails/activesupport/lib/active_support/core_ext/module/aliasing.rb:28:in `alias_method':NameError: undefined method `process' for class `ActionController::Base'
    /my_app/vendor/rails/activesupport/lib/active_support/dependencies.rb:266:in `load_missing_constant':NameError: uninitialized constant UserLogging
    Chris Bloom
    Web Application Developer


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •