`
anke1460
  • 浏览: 42501 次
  • 性别: Icon_minigender_1
  • 来自: 上海
最近访客 更多访客>>
社区版块
存档分类
最新评论

Silencing Rails 2.2 "gem has no specification" messages

阅读更多
Since upgrading to Rails 2.2, you might be seeing lots of messages like this:

config.gem: Unpacked gem blah-1.0.0 in vendor/gems
has no specification file. Run 'rake gems:refresh_specs' to fix this.


Running 'rake gems:refresh_specs" takes care of most of these, and upgrading any remaining gems will usually take care of the rest. But it seems like most of the projects I'm on still have one or three home-grown, really old, or really odd gems that just don't have specs. I should write specs for these, I know. So I let Rails complain... but...

But now, months later, I'm realizing there are just a few gems I'm never going to upgrade. And I'm seeing these messages... A LOT. Every time I run a test in TextMate. Every time I run tests from rake. Every time I run almost any rake task, period. It's driving me MAD!

So, if you've been a good boy or girl and taken care of most your gems, and a few are still hanging around, here's the magic to make those messages go away:

In your config/environment.rb file:

# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), 'boot')

# Add this line at your own risk! 
Rails::VendorGemSourceIndex.silence_spec_warnings = true

Rails::Initializer.run do |config|


url:http://tech.hickorywind.org/articles/2009/02/02/silencing-rails-2-2-gem-has-no-specification-messages
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics