Topic: Issues with running a rails 2 project on local machine

Hi,

I have been trying to run an existing rails 2 project on my dev machine to make some changes to it. But i get the following errors .Can someone help me out as to what is needed to make this project run. I have installed all the required gems and database

ruby script/server
=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:Warning:
Gem::Dependency#version_requirements is deprecated and will be removed
on or after August 2010.  Use #requirement
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:440:in
`load_missing_constant': uninitialized constant Earth::Db (NameError)
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:80:in
`const_missing'
  from /root/mysite/webapp/config/environments/development.rb:66:in
`load_environment'
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/rails-2.3.5/lib/initializer.rb:386:in
`load_environment'
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/core_ext/kernel/reporting.rb:11:in
`silence_warnings'
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/rails-2.3.5/lib/initializer.rb:379:in
`load_environment'
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/rails-2.3.5/lib/initializer.rb:137:in
`process'
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/rails-2.3.5/lib/initializer.rb:113:in
`send'
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/rails-2.3.5/lib/initializer.rb:113:in
`run'
  from /root/mysite/webapp/config/environment.rb:11
  from
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
`gem_original_require'
  from
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
`require'
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
`require'
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:521:in
`new_constants_in'
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/activesupport-2.3.5/lib/active_support/dependencies.rb:156:in
`require'
  from /root/mysite/webapp/config.ru:4
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/builder.rb:29:in
`instance_eval'
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/rack-1.0.1/lib/rack/builder.rb:29:in
`initialize'
  from /root/mysite/webapp/config.ru:1:in `new'
  from /root/mysite/webapp/config.ru:1
  from
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
`eval'
  from
/usr/local/rvm/gems/ruby-1.8.7-p357/gems/rails-2.3.5/lib/commands/server.rb:78
  from
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
`gem_original_require'
  from
/usr/local/rvm/rubies/ruby-1.8.7-p357/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in
`require'
  from script/server:3

Can some one Please help me to understand what needs to be corrected to
make it runnable.

Last edited by hungry fish (2012-02-13 11:35:17)

Re: Issues with running a rails 2 project on local machine

If you look through the stack trace, and look for files that are part of your actual app,  you'll see:


from /root/mysite/webapp/config/environment.rb:11

and

from /root/mysite/webapp/config/environments/development.rb:66:in

So that's where you start looking.

Plus you'll have to explain exactly how you set up your rails.

If the existing app was running on rails 2.3.5,  and you correctly set up a clean 2.3.5 install on your new dev box,  all you'd have to do is check which gems were installed on the old system,  and get those versions of the gems on the new system.

I'd start doing

gem list

on the old box,  then

gem list

on the new box,  and get them to match up!

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Issues with running a rails 2 project on local machine

Hi Brad,

This is an old project and I would have to set up the gems mentioned in the environment.rb file. I tried doing that and install all the gems mentioned in there. Still I am left with this error.

Re: Issues with running a rails 2 project on local machine

Post environment.rb and development.rb

make sure you put them in [c o d e] [/c o d e]

also did you grab the exact same versions of the gems required by your app?

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Issues with running a rails 2 project on local machine

small business video production

Re: Issues with running a rails 2 project on local machine

Hi this is the environment.rb file  of my project. I have installed the gems mentioned in here. But still I face some kind of error.

# Be sure to restart your server when you modify this file

# Preinitializers (such as RAILS_ENV assignments) now go in config/preinitializer.rb

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

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

Rails::Initializer.run do |config|
  # Settings in config/environments/* take precedence over those specified here.
  # Application configuration should go into files in config/initializers
  # -- all .rb files in that directory are automatically loaded.
  # See Rails::Configuration for more options.

  # Skip frameworks you're not going to use. To use Rails without a database
  # you must remove the Active Record framework.
  # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]

  # Specify gems that this application depends on.
  # They can then be installed with "rake gems:install" on new installations.
  # config.gem "bj"
  # config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
  config.gem 'rack',          :veriosn => '= 1.0.1'
  config.gem 'memcache-client', :veriosn => '>= 1.8.3'
  config.gem 'newrelic_rpm',  :version => '>= 2.9.0'
  config.gem 'atlas',         :version => '0.0.1'
  config.gem "aws-s3",        :version => '>= 0.6.2', :lib => "aws/s3"
  config.gem 'exifr',         :version => '>= 0.10.8'
  config.gem 'json',          :version => '>= 1.1.4'
  config.gem 'libxml-ruby',   :version => '>= 1.1.0', :lib => 'xml'
  config.gem 'libxslt-ruby',  :version => '>= 0.9.1', :lib => 'libxslt'
  config.gem 'rest-client',   :version => '>= 0.9.2', :lib => 'rest_client'
  config.gem 'RedCloth',      :version => '>= 4.1.0', :lib => 'redcloth'
  config.gem 'uuidtools',     :version => '>= 2.0.0'
  config.gem 'rmagick',       :lib => 'RMagick'
  config.gem 'GeoRuby',       :lib => 'geo_ruby', :version => '>= 1.3.4'
  config.gem 'markevans-block_helpers', :lib => 'block_helpers'
  config.gem 'bunny',         :version => '>= 0.5.2'
  config.gem 'twitter4r',     :version => '>= 0.3.2', :lib => 'twitter'
  config.gem 'will_paginate', :version => '>= 2.3'
  config.gem 'authlogic', :version => '>= 2.1.3'
 
  # Only load the plugins named here, in the order given. By default, all plugins
  # in vendor/plugins are loaded in alphabetical order.
  # :all can be used as a placeholder for all plugins not explicitly named
  # config.plugins = [ :exception_notification, :ssl_requirement, :all ]

  # Add additional load paths for your own custom dirs
  # config.load_paths += %W( #{RAILS_ROOT}/extras )

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

  # Make Time.zone default to the specified zone, and make Active Record store time values
  # in the database in UTC, and return them converted to the specified local zone.
  # Run "rake -D time" for a list of tasks for finding time zone names. Uncomment to use default local time.
  config.time_zone = 'UTC'

  # 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 = {
    :key => '_www.xyz.com_session',
    :secret      => '422cdbeee5f72eff4a9a75eb3330ce5d6d90ae31048dad9bfc51c2'
  }

  # Use the database for sessions instead of the cookie-based default,
  # which shouldn't be used to store highly confidential information
  # (create the session table with "rake db:sessions:create")
  # config.action_controller.session_store = :active_record_store
  # config.action_controller.session_store = :p_store

  # 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 = :cacher, :garbage_collector
end

Re: Issues with running a rails 2 project on local machine

Few things to check,  the RMagick gem,  that requires that the RMagic binaries are installed in a seperate installation step,  you have to go to RMagick site,  and follow the install instructions and make sure RMagick runs stand alone on your dev box BEFOR you try and use the Rails gem for RMagick.

Otherwise,  I'd just comment out all gems except one,  then see if rails boots,  if it does, uncomment another, see if it boots,  repeat process until rails doesn't boot,  and you'll know which gem is causing the problem.

Joe got a job, on the day shift, at the Utility Muffin Research Kitchen, arrogantly twisting the sterile canvas snout of a fully charged icing anointment utensil.

Re: Issues with running a rails 2 project on local machine

Hey,

Manage to fix the problem. It turns out I had to install a few plugins not mentioned in the evironment.rb and authlogic gem coflict.
Now its booting but still some errors to solve to get it fully running.