2

コマンド rake db:migrate を実行しようとすると、次のエラーが表示されます。

> NOTE: Gem.source_index is deprecated, use Specification. It will be
> removed on or after 2011-11-01. Gem.source_index called from
> /home/hilarl/workspace/depot/vendor/rails/railties/lib/rails/gem_dependency.rb:21.
> NOTE: Gem::SourceIndex#initialize is deprecated with no replacement.
> It will be removed on or after 2011-11-01. Gem::SourceIndex#initialize
> called from
> /home/hilarl/workspace/depot/vendor/rails/railties/lib/rails/vendor_gem_source_index.rb:100.
> NOTE: Gem::SourceIndex#add_spec is deprecated, use
> Specification.add_spec. It will be removed on or after 2011-11-01.
> Gem::SourceIndex#add_spec called from
> /home/hilarl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
> NOTE: Gem::SourceIndex#add_spec is deprecated, use
> Specification.add_spec. It will be removed on or after 2011-11-01.
> Gem::SourceIndex#add_spec called from
> /home/hilarl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
> NOTE: Gem::SourceIndex#add_spec is deprecated, use
> Specification.add_spec. It will be removed on or after 2011-11-01.
> Gem::SourceIndex#add_spec called from
> /home/hilarl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
> NOTE: Gem::SourceIndex#add_spec is deprecated, use
> Specification.add_spec. It will be removed on or after 2011-11-01.
> Gem::SourceIndex#add_spec called from
> /home/hilarl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
> NOTE: Gem::SourceIndex#add_spec is deprecated, use
> Specification.add_spec. It will be removed on or after 2011-11-01.
> Gem::SourceIndex#add_spec called from
> /home/hilarl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
> NOTE: Gem::SourceIndex#add_spec is deprecated, use
> Specification.add_spec. It will be removed on or after 2011-11-01.
> Gem::SourceIndex#add_spec called from
> /home/hilarl/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:91.
> WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require
> 'rdoc/task' (in RDoc 2.4.2+)' instead.
>     at /home/hilarl/.rvm/gems/ruby-1.9.3-p194@global/gems/rake-0.9.2.2/lib/rake/rdoctask.rb
> rake aborted! can't activate activesupport-3.2.3, already activated
> activesupport-2.3.14
> 
> (See full trace by running task with --trace)

なぜこれが起こっているのですか?私はubuntuを使用しており、システムにruby 1.9.3-p194とrails 2.3.14をインストールし、sqlite3を使用しています

4

2 に答える 2

1

走ってみませんか

bundle exec rake db:migrate

システムに同じ gem の異なるバージョンをインストールすることができます。そのため bundle exec <command> 、バージョンがプロジェクトの Gemfile に関連付けられている gem を使用します (Gemfile.lock ファイルで gem を検索して、どのバージョンが使用されているかを確認してください)。

コンテキスト内のプロジェクトに基づいてアクティブ化される gem の選択したバージョンをパッケージ化するための gemset を作成することをお勧めします。

http://bcardarella.com/post/699582642/rvm-gemsets-bundler-awesome

于 2012-05-23T04:40:06.000 に答える
1

インストールしたレールのバージョンを確認します。

$ gem list rails

*** LOCAL GEMS ***

rails (3.2.3, 2.3.14)

ここで 3.2.3 と 2.3.14 を行うように、それらを複数用意する必要があります。

その後、必要のないものをアンインストールします。

$ gem uninstall rails -v2.3.14
Remove executables:
    rails

in addition to the gem? [Yn]  Y
Removing rails
Successfully uninstalled rails-2.3.14

最後に、レールのバージョンは 1 つだけにする必要があります。

$ gem list rails

*** LOCAL GEMS ***

rails (3.2.3)
于 2012-05-23T06:10:40.080 に答える