开发者

Help with: already initialized constant RUBY?

I'm running Ruby 1.9.2 and Rails 3.1 locally and I'm trying to fire up my app. Whenever I use rake (rake spec, rake cucumber, rake db:create) I get these warnings. What did I do wrong?

/Users/me/.rvm/gems/ruby-1.9.2-p290/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY
/Users/me/.rvm/gems/ruby-1.9.2-p290/gems/rake-开发者_C百科0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED

Thanks for any pointers in the right direction!


This is caused when you are using Ruby 1.9.2 (that already comes with rake bundled) and you installed the rake gem, for example using bundler.

You can

  1. uninstall the rake gem

    $ gem uninstall rake
    
  2. If you use bundler, keep using bundler. In this case, the right syntax is

    $ bundle exec rake spec
    

    not

    $ rake spec
    


The warnings may fade if you prefix your calls to rake with bundle exec, i.e.

bundle exec rake spec
bundle exec rake cucumber

ian.


It seems to me that you've 1 unnecessary require 'rake' in your code

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜