rake db:migrate 在 rails 中不起作用

rake db:migrate 在 rails 中不起作用

我在终端中执行了以下语句:

rails tickets
cd tickets
ruby script/server      //to run the app tickets on localhost:3000
ruby script/generate  scaffold ticket name:string seat:string address:text price_paid:decimal email_address:string

执行完上述所有操作后,我执行了迁移脚本rake db:migrate,然后尝试在浏览器中打开,localhost:3000/tickets显示以下消息:

“很抱歉,出了点问题。”而不是打开应用程序

以下是 rake 命令的输出:

vverma@l-vverma:~/tickets$ 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/vverma/tickets/config/../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/vverma/tickets/config/../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 /usr/lib/ruby/vendor_ruby/1.8/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 /usr/lib/ruby/vendor_ruby/1.8/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 /usr/lib/ruby/vendor_ruby/1.8/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 /usr/lib/ruby/vendor_ruby/1.8/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 /usr/lib/ruby/vendor_ruby/1.8/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 /usr/lib/ruby/vendor_ruby/1.8/rubygems/source_index.rb:91.
WARNING: 'require 'rake/rdoctask'' is deprecated.  Please use 'require 'rdoc/task' (in RDoc 2.4.2+)' instead.
    at /usr/lib/ruby/vendor_ruby/rake/rdoctask.rb
Please install RDoc 2.4.2+ to generate documentation.

答案1

我在尝试运行 rails 教程时遇到了类似的情况

所有以“注意:Gem:: 等”为标题的行都是对弃用命令的警告,该命令将在 2011-11-1 或之后消失,并提供有关如何在编码中替换弃用命令的建议。

但是命令已经执行。请检查结果。

最后几行开头是:

`警告:'需要

--等与已弃用且已删除的命令有关。这可能是这里唯一的硬错误,其余的只是信息警告。

我担心,获取 Ruby、Rails 和 gems 的正确版本号是解决这些问题的唯一方法。

祝你好运,伯尼

相关内容