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

v2を使用すると機能しないため、Rakefileを変更してrails3に変換する必要がありました。

# 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