gpt4 book ai didi

ruby-on-rails - 尝试运行 rake db :migrate 时出错

转载 作者:太空宇宙 更新时间:2023-11-03 16:07:24 24 4
gpt4 key购买 nike

当我尝试命令 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

最佳答案

检查你安装的rails版本:

$ 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

最后你应该只有一个版本的 rails:

$ gem list rails

*** LOCAL GEMS ***

rails (3.2.3)

关于ruby-on-rails - 尝试运行 rake db :migrate 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10713358/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com