Rails 3 快要杀了我<救命>

发布于 2024-09-15 04:50:39 字数 466 浏览 3 评论 0原文

我最近刚刚切换到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

空城仅有旧梦在 2024-09-22 04:50:40

我认为问题与 db:migrate rask 无关——我认为您的 Rails 环境尚未完全设置。要尝试的事情:

确认您的 config/application.rb 看起来有点像以下内容

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

require 'rails/all'

Bundler.require(:default, Rails.env) if defined?(Bundler)

module Moolah
  class Application < Rails::Application
...

从根目录进行捆绑安装

bundle install

然后尝试进入控制台

rails console

一旦一切正常,您的应用程序就是“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

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

require 'rails/all'

Bundler.require(:default, Rails.env) if defined?(Bundler)

module Moolah
  class Application < Rails::Application
...

Do a bundle install from your root directory

bundle install

Then try to get into your console

rails console

Once that all works, your app is "rails 3" and can then rake db:migrate

苏佲洛 2024-09-22 04:50:40

还要小心您拥有的 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.

咽泪装欢 2024-09-22 04:50:40

从您得到的错误来看,我想说您的 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文