1

我这里有问题。我正在尝试将我的应用程序从 rails v2.3.11 更新到 v3.0.20,然后从那里向上移动。我已经按照 Ryan Bate 和其他教程来执行此操作,但是,当尝试在 rails2 之上创建 rails3 应用程序时,我得到以下信息:

Tomas-MacBook-Pro:yfl_curr tomas$ rails new . --force
Can't initialize a new Rails application within the directory of another, please change to a non-Rails directory first.
Type 'rails' for help.

环境:

Tomas-MacBook-Pro:yfl_curr tomas$ ruby -v
ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin12.4.0]

Tomas-MacBook-Pro:yfl_curr tomas$ rails -v
Rails 3.0.20

我不得不更改Rakefile并将其转换为 rails3,因为如果使用 v2,它将无法工作:

# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)
require 'rake'

SampleApp::Application.load_tasks

还更改了boot.rb以反映这一点:

require 'rubygems'

# Set up gems listed in the Gemfile.
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)

require 'bundler/setup' if File.exists?(ENV['BUNDLE_GEMFILE'])

顺便说一句,我正在使用捆绑器。如果我运行“rake rails:upgrade:check”它工作正常。

我究竟做错了什么?

谢谢大家的帮助!!

问候,汤姆

4

0 回答 0