Skip to content

Instantly share code, notes, and snippets.

@kracekumar
Created April 25, 2011 04:55
Show Gist options
  • Save kracekumar/940173 to your computer and use it in GitHub Desktop.
Save kracekumar/940173 to your computer and use it in GitHub Desktop.
problem with config.load_once_paths,config.load_paths
require File.join(File.dirname(__FILE__), 'boot')
RAILS_GEM_VERSION = '2.3.9' unless defined? RAILS_GEM_VERSION
Rails::Initializer.run do |config|
config.time_zone = 'UTC'
config.gem 'declarative_authorization', :source => 'http://gemcutter.org'
config.gem 'searchlogic'
config.gem 'prawn', :version=> '0.6.3'
config.load_once_paths+= %W( #{RAILS_ROOT}/lib )
config.load_paths+= Dir["#{RAILS_ROOT}/app/models/*"].find_all { |f| File.stat(f).directory? }
end
#warning message
Rails 2.3.9 application starting on http://0.0.0.0:3000
config.load_once_paths is deprecated and removed in Rails 3, please use autoload_once_paths instead
config.load_once_paths= is deprecated and removed in Rails 3, please use autoload_once_paths= instead
config.load_paths is deprecated and removed in Rails 3, please use autoload_paths instead
config.load_paths= is deprecated and removed in Rails 3, please use autoload_paths= instead
config.load_paths is deprecated and removed in Rails 3, please use autoload_paths instead
config.load_paths= is deprecated and removed in Rails 3, please use autoload_paths= instead
#new_environment.rb
require File.join(File.dirname(__FILE__), 'boot')
RAILS_GEM_VERSION = '2.3.9' unless defined? RAILS_GEM_VERSION
Rails::Initializer.run do |config|
config.time_zone = 'UTC'
config.gem 'declarative_authorization', :source => 'http://gemcutter.org'
config.gem 'searchlogic'
config.gem 'prawn', :version=> '0.6.3'
autoload_once_paths+= %W( #{RAILS_ROOT}/lib )
autoload_paths+= Dir["#{RAILS_ROOT}/app/models/*"].find_all { |f| File.stat(f).directory? }
end
#error
/var/www/happy_school/config/environment.rb:13: undefined method `+' for nil:NilClass (NoMethodError)
from /var/lib/gems/1.8/gems/rails-2.3.9/lib/initializer.rb:111:in `run'
from /var/www/happy_school/config/environment.rb:6
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.9/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/activesupport-2.3.9/lib/active_support/dependencies.rb:547:in `new_constants_in'
from /var/lib/gems/1.8/gems/activesupport-2.3.9/lib/active_support/dependencies.rb:182:in `require'
from /var/lib/gems/1.8/gems/rails-2.3.9/lib/commands/server.rb:84
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
from script/server:3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment