Rails 3 快要杀了我<救命>救命>
我最近刚刚切换到 Rails 3。我遇到了几个安装问题,但仍然无法执行在 Rails 2 中可以执行的操作。现在,由于某种原因,当我想做
rake db:migrate
时,出现以下错误
rake aborted!
uninitialized constant ActiveSupport::CoreExtensions
/Users/denniss/Sites/mp/Rakefile:4:in `require'
我的 Rakefile 看起来像这样
require File.expand_path('../config/application', __FILE__)
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
Moolah::Application.load_tasks
I just recently switched to Rails 3. I have been through several installation problems and still is unable to do the stuff that I could do in Rails 2. Right now for some reason when I want to do
rake db:migrate
I get the following error
rake aborted!
uninitialized constant ActiveSupport::CoreExtensions
/Users/denniss/Sites/mp/Rakefile:4:in `require'
My Rakefile looks like this
require File.expand_path('../config/application', __FILE__)
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
Moolah::Application.load_tasks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我认为问题与 db:migrate rask 无关——我认为您的 Rails 环境尚未完全设置。要尝试的事情:
确认您的 config/application.rb 看起来有点像以下内容
从根目录进行捆绑安装
然后尝试进入控制台
一旦一切正常,您的应用程序就是“rails 3”,然后就可以
耙数据库:迁移
I don't think the problem is related to the db:migrate rask -- I think your rails environment isn't fully setup yet. Things to try:
Confirm that your config/application.rb looks somewhat like the following
Do a bundle install from your root directory
Then try to get into your console
Once that all works, your app is "rails 3" and can then
rake db:migrate
还要小心您拥有的 ruby 版本。当我第一次尝试 Rails 3 时,我有 ruby 1.9.2 预览版(我在一年前安装了它),但没有任何效果像我预期的那样......我更新到了新版本,现在一切都运行顺利。
Also be careful with the ruby version you have. I had ruby 1.9.2 preview (I installed it before a year) when I was first tried rails 3 and nothing was working as I expected... I updated to the new version and now everything is working smooth.
从您得到的错误来看,我想说您的 activesupport gem 有问题。要么它没有安装(至少没有安装正确的版本),要么由于某种原因没有加载。
尝试使用“gem list”列出您的 gem,并查看您拥有的 activesupport gem 版本以及它们是否与 Rails gem 版本匹配。
From the error you get I would say that you have a problem with activesupport gem. Either it's not installed (at least proper version is not installed) or it's not loaded for some reason.
Try listing your gems with "gem list" and see what versions of activesupport gem you have and if they match Rails gem versions.