English 中文(简体)
试图运行 Rake db: migraty 时发生错误
原标题:Getting an error when trying to run rake db:migrate

当我尝试命令rake db: migraty 时, 我正收到以下错误 。

> 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,我系统安装了红宝石1.9.3-p194和铁路2.3.14,并使用Sqlite3。

最佳回答

检查您安装的栏杆版本 :

$ 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

最后,你应该只有一个版本的铁路:

$ gem list rails

*** LOCAL GEMS ***

rails (3.2.3)
问题回答

你能尝试跑步吗?

捆绑 exec rake db: migrate

您可以在您的系统中安装同一宝石的不同版本 - 所以 < code> bagly exec & lt; command> 使用与您的项目 Gemfile 连结的宝石( 在 Gemfile. lock 文件搜索您的宝石以查看使用哪个版本 ) 。

一种更好的做法是创建宝石套件,以包装将根据项目背景启动的特定版本的宝石。

http://bcarcarcarella.com/pospos6995822/rvm-gemsets-bundler-aweome





相关问题
rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

SSL slowness in EC2

We ve deployed our rails app to EC2. In our setup, we have two proxies on small instances behind round-robin DNS. These run nginx load balancers for a dynamically growing and shrinking farm of web ...

Auth-code with A-Za-z0-9 to use in an URL parameter

As part of a web application I need an auth-code to pass as a URL parameter. I am currently using (in Rails) : Digest::SHA1.hexdigest((object_id + rand(255)).to_s) Which provides long strings like : ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

activerecord has_many :through find with one sql call

I have a these 3 models: class User < ActiveRecord::Base has_many :permissions, :dependent => :destroy has_many :roles, :through => :permissions end class Permission < ActiveRecord::...

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

How to get SQL queries for each user where env is production

I’m developing an application dedicated to generate statistical reports, I would like that user after saving their stat report they save sql queries too. To do that I wrote the following module: ...

热门标签