rake db出错:使用mongrel迁移,“找不到杂种”

时间:2011-11-20 03:39:12

标签: ruby-on-rails

我正在尝试在ubuntu 10.04上安装track,ruby on rails应用程序。 Bundle安装工作正常,但是当我运行rake db:migrate时,我得到了一些弃用警告,然后声称该系统“无法找到mongrel”的错误,尽管它已安装。如果我列出gems mongrel显然在列表中,但是当运行rake命令时我得到了这个错误。有什么想法吗?

Could not find mongrel (~> 1.1.5) amongst [rake-0.9.2.2, RedCloth-4.2.8, 
ZenTest-4.6.1, aasm-2.2.0, activesupport-2.3.14, rack-1.1.0, actionpack-2.3.14, 
actionmailer-2.3.14, activerecord-2.3.14, activeresource-2.3.14, acts_as_list-0.1.4, 
archive-tar-minitar-0.5.2, bcrypt-ruby-2.1.4, builder-3.0.0, bundler-1.0.18, 
columnize-0.3.4, diff-lcs-1.1.2, json-1.5.3, gherkin-2.4.11, term-ansicolor-1.0.6, cucumber-1.0.2, cucumber-rails-0.3.2, daemons-1.0.10, database_cleaner-0.6.7, flexmock-0.9.0, gem_plugin-0.2.3, has_many_polymorphs-2.13, highline-1.5.2, hoe-2.12.0, hpricot-0.8.4, htmlentities-4.3.0, i18n-0.6.0, ruby_core_source-0.1.5, linecache19-0.5.12, mime-types-1.16, polyglot-0.3.2, treetop-1.4.10, mail-2.3.0, memory_test_fix-0.1.3, mongrel-1.2.0.pre2, nokogiri-1.4.7, rack-test-0.6.1, rails-2.3.14, rspec-1.3.2, rspec-rails-1.3.4, ruby-debug-base19-0.11.25, ruby-debug19-0.11.6, ruby-openid-2.1.8, rubycas-client-2.2.1, rubyjedi-actionwebservice-2.3.5.20100714122544, sanitize-1.2.1, selenium-client-1.2.18, soap4r-ruby1.9-2.0.3, sqlite3-1.3.4, test-unit-1.2.3, thoughtbot-factory_girl-1.2.2, webrat-0.7.3, will_paginate-2.3.16, yard-0.7.3]

2 个答案:

答案 0 :(得分:3)

尝试在Gemfile中评论mongrel并执行:

(shell) $ mv ./config/initializers/mongrel_workaround.rb ./tmp/

然后,如果您有以下消息: “(... / tracks / config / locales / cz.yml):无法在第438行第13列解析YAML。”,你可以修复它在./config/boot.rb中添加这些行(在开头,在RAILS_ROOT = ...)之后:

require 'yaml'
YAML::ENGINE.yamler = 'syck'

然后最后再试一次:

(shell) $ RAILS_ENV=production bundle exec rake db:migrate

答案 1 :(得分:0)

尝试bundle exec rake db:migrate