【问题标题】:Configuring and running Ruby-On-Rails migrations配置和运行 Ruby-On-Rails 迁移
【发布时间】:2011-01-14 16:46:27
【问题描述】:

我(完全)是 ROR 的新手,并且有一个应用程序需要维护和升级。我有源代码,正在尝试使用db:migrate rake 命令构建数据库。我已经开始使用 Aptana Studio 进行开发。当我运行 dg:migrate 时,出现以下错误:

rake db:migrate
(in G:/Projects/.../.../trunk)
MissingSourceFile no such file to load -- rcov/rcovtask
WARNING: rcov tests won't work
Looking for release_type overrides ...
=> Loading G:/Projects/.../.../trunk/config/release_type_config.rb
DEPRECATION WARNING: ActiveRecord::Base.allow_concurrency=has been deprecated and
no longer has any effect. Please remove all references to allow_concurrency=.. 
(called from allow_concurrency= at D:/Ruby/lib/ruby/gems/1.8/gems/
activerecord-2.3.5/lib/active_record/connection_adapters/abstract/
connection_specification.rb:98)
DEPRECATION WARNING: ActiveRecord::Base.verification_timeout= has been deprecated
and no longer has any effect. Please remove all references to 
verification_timeout=.. (called from verification_timeout= at    
D:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.5/lib/active_record/
connection_adapters/abstract/connection_specification.rb:108)
rake aborted!
no such file to load -- hpricot

我也安装了 hpricot gem(0.8 版)。

对此有什么补救措施?

【问题讨论】:

    标签: ruby-on-rails rubygems rake aptana dbmigrate


    【解决方案1】:

    也许您的系统找不到宝石。这可能是路径问题,请参阅this post for details

    【讨论】:

    • @JRL 我已经在 Aptana 设置中正确配置了路径,并且所有目录都在 %path% env 中注册。变量
    【解决方案2】:

    安装 rcov gem:

    gem install relevance-rcov --source http://gems.github.com
    

    【讨论】:

    • 执行在 hpricot 处停止。 rcov 需求刚刚生成了一个警告。
    • @neutrino 我已经检查过 hpricot 没有安装,因为 gcc 不可用。我已经安装了 MinGW32 和 mingw32-make。我尝试使用您提供的命令安装 rcov,但出现此错误:mingw32-make.exe: *** No rule to make target ruby.h',需要 callsite.o'.
    【解决方案3】:

    最大的错误是

    rake aborted!
    no such file to load -- hpricot
    

    你需要 hpricot。您可以在命令行上运行以下命令安装它

    gem install hpricot
    

    【讨论】:

    • @simone 我在运行gem install hpricot 时遇到此错误 -> Building native extensions. This could take a while... ERROR: Error installing hpricot: ERROR: Failed to build gem native extension. ruby.exe extconf.rb checking for stdio.h... yes creating Makefile make mingw32-make.exe mingw32-make.exe: *** No rule to make target ruby.h',fast_xs.o'. S top. Gem files will remain installed in D:/Ruby/lib/ruby/gems/1.8/gems/hpricot-0.8.2 for inspection. Results logged to D:/Ruby/lib/ruby/gems/1.8/gems/hpricot-0.8.2/ext/fast_xs/gem_m ake.out 需要此错误
    • 这是因为您的机器上没有编译器。你需要安装一个编译好的 Gem。尝试指定您的环境gem install hpricot --platform x86-mingw32
    • 运气不好@simone 得到同样的错误。我已经安装了 MinGW32,所以我有 gcc 等。如果需要其他任何东西,请告诉我,或者我是否可以从某个地方获得编译的 gem。
    • gem install hpricot --platform mswin32 工作正常。我从这里得到它:bit.ly/aBRXRU
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-10-29
    • 2015-04-09
    • 2019-12-24
    • 1970-01-01
    • 2012-11-11
    • 1970-01-01
    相关资源
    最近更新 更多