我无法在Rails 3中获得回溯

时间:2012-06-26 17:08:41

标签: ruby-on-rails-3.1

我正在尝试运行常用的rails命令(rails s,rails g,rails c等)并且我遇到错误(因为我正在从MRI ruby​​和postgres迁移到jruby和neo4j),这会如果只有堆栈跟踪,那就好了。

看起来像这样:

$ rails s
NameError: uninitialized constant Authorization::ActiveRecord

我期待这样的错误,因为Neo4j不使用ActiveRecord并且它不再存在,但我真的需要看看哪个文件正在调用ActiveRecord,所以我可以解决这个问题。但是我从谷歌找到的或者在代码中尝试过的东西都没有给我带来回溯。 ; _;

我的config / application.rb是:

require File.expand_path('../boot', __FILE__)

require 'action_controller/railtie'
require 'action_mailer/railtie'
require 'active_resource/railtie'
require 'rails/test_unit/railtie'
require 'sprockets/railtie'
require 'neo4j'

if defined?(Bundler)
  # If you precompile assets before deploying to production, use this line
  Bundler.require *Rails.groups(:assets => %w(development test))
  # If you want your assets lazily compiled in pro      duction, use this line
  # Bundler.require(:default, :assets, Rails.env)
end

module MyApp
  class Application < Rails::Application
    # Enable the asset pipeline
    config.assets.enabled = true

    # Version of your assets, chanmge this if you want to expire all your assets
    config.assets.version = '1.1'

    # 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.

    # Custom directories with classes and modules you want to be autoloadable.
    # config.autoload_paths += %W(#{config.root}/extras)

    # this was done to load all modules in lib
    # following directions at: https://stackoverflow.com/questions/3356742/best-way-to-load-module-class-from-lib-folder-in-rails-3/3962321#3962321
    config.autoload_paths += Dir["#{config.root}/lib/**/"]

    #for rails-ckeditor
    config.autoload_paths += %W( #{config.root}/app/models/ckeditor )


    # Only load the plugins named here, in the order given (default is alphabetical).
    # :all can be used as a placeholder for all plugins not explicitly named.
    # config.plugins = [ :exception_notification, :ssl_requirement, :all ]

    # Activate observers that should always be running.
    # config.active_record.observers = :cacher, :garbage_collector, :forum_observer

    # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
    # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
    # config.time_zone = 'Central Time (US & Canada)'

    # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
    # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
    # config.i18n.default_locale = :de

    # JavaScript files you want as :defaults (application.js is always included).
    # config.action_view.javascript_expansions[:defaults] = %w(jquery rails)

    # Configure the default encoding used in templates for Ruby 1.9.
    config.encoding = "utf-8"

    # Configure sensitive parameters which will be filtered from the log file.
    config.filter_parameters += [:password]

  end
end

我的config / environments / development.rb是:

MyApp::Application.configure do
  # Settings specified here will take precedence over those in config/application.rb

  # In the development environment your application's code is reloaded on
  # every request.  This slows down response time but is perfect for development
  # since you don't have to restart the webserver when you make code changes.
  config.cache_classes = false

  # Log error messages when you accidentally call methods on nil.
  config.whiny_nils = true

  # Show full error reports and disable caching
  config.consider_all_requests_local       = true
  #config.action_view.debug_rjs             = true $ turn off for rails 3.1
  config.action_controller.perform_caching = false

  # Don't care if the mailer can't send
  config.action_mailer.raise_delivery_errors = false

    #Devise wants this:
  config.action_mailer.default_url_options = { :host => 'localhost:3000' }

  # Print deprecation notices to the Rails logger
  config.active_support.deprecation = :log

  # Only use best-standards-support built into browsers
  config.action_dispatch.best_standards_support = :builtin

  config.log_level = :debug

  # Do not compress assets
  config.assets.compress = false

  # Expand the lines which load the assets
  config.assets.debug = true
end

我不知道任何可能影响记录器/回溯情况的其他文件。我会包含更多,但这感觉就像一个普遍的问题我真的不知道要包括什么。

更新:我很确定这个问题与here重复(虽然我试图让它在任何环境中运行)。

0 个答案:

没有答案