我确定我错过了一些基本的东西。
我在开发环境中有一个正常工作的应用程序。比我有一些我无法正确解释的修改(使用迁移并尝试插入seed_dump gem)。现在每个 rake 命令都会抛出一个错误:
C:\Programozas\Rails Apps\sorsveto>rake about
rake aborted!
undefined method `active_record' for #<Rails::Application::Configuration:0x3e482
98>
Tasks: TOP => about => environment
(See full trace by running task with --trace)
或者
C:\Programozas\Rails Apps\sorsveto>rake db:migrate
rake aborted!
Don't know how to build task 'db:migrate'
(See full trace by running task with --trace)
有我的gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.2'
gem 'bootstrap-sass', '2.0.0'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.5'
group :development do
gem 'sqlite3', '1.3.5'
gem 'annotate', '~> 2.4.1.beta'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
group :test, :development do
gem 'rspec-rails', '~> 2.8.rc'
gem 'shoulda', '~> 3.0.1'
gem 'shoulda-context'
gem 'shoulda-matchers'
gem 'eventmachine', '1.0.0.rc.4'
gem 'listen', '0.4.7'
gem 'guard-livereload', '1.0.0'
gem 'guard-rspec', '0.5.5'
gem 'guard-spork', '0.3.2'
gem 'spork', '0.9.0'
end
group :test do
gem 'capybara', '1.1.2'
gem 'factory_girl_rails', '1.4.0'
gem 'cucumber-rails', '1.2.1'
gem 'database_cleaner', '0.7.0'
end
# Test gems on Windows
group :test do
gem 'rb-fchange', '0.0.5'
gem 'rb-notifu', '0.0.4'
gem 'win32console', '1.3.0'
end
group :production do
gem 'pg', '0.12.2'
end
我不知道如何解决这个问题。我尝试重新安装或安装 0.8.7 并删除它(现在我有版本 0.9.2.2)。我什至尝试安装 0.9.2。许多组合(一次多个并运行 bundle exec rake XY)没有成功。我什至尝试将其插入到我的 gem 文件中:
require 'rake/dsl_definition'
require 'rake'
都没有帮助。有任何想法吗?所有帮助mutch appriciated。