1

我正在尝试使用fuzzy-string-match宝石。如果我尝试加载irb并输入,require 'fuzzystringmatch'我会收到所有这些错误

/Users/user/.rvm/gems/ruby-1.9.3-p125/gems/fuzzy-string-match-0.9.3/lib/fuzzystringmatch/inline/jarowinkler.rb:41:30: error: implicit conversion loses
  integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
_max = s1; _max_length = strlen(s1);
                       ~ ^~~~~~~~~~
/Users/user/.rvm/gems/ruby-1.9.3-p125/gems/fuzzy-string-match-0.9.3/lib/fuzzystringmatch/inline/jarowinkler.rb:42:30: error: implicit conversion loses
  integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
_min = s2; _min_length = strlen(s2);
                       ~ ^~~~~~~~~~
/Users/user/.rvm/gems/ruby-1.9.3-p125/gems/fuzzy-string-match-0.9.3/lib/fuzzystringmatch/inline/jarowinkler.rb:45:30: error: implicit conversion loses
  integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
_max = s2; _max_length = strlen(s2);
                       ~ ^~~~~~~~~~
/Users/user/.rvm/gems/ruby-1.9.3-p125/gems/fuzzy-string-match-0.9.3/lib/fuzzystringmatch/inline/jarowinkler.rb:46:30: error: implicit conversion loses
  integer precision: 'size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
_min = s1; _min_length = strlen(s1);

我做错什么了吗?我没有更改代码或任何东西。我将如何解决这个问题?有没有人遇到过这个问题?

4

1 回答 1

1

我通过 sym 将 /usr/bin/cc 链接到 /usr/bin/gcc 解决了这个问题。我在 Mountain Lion 上,Apple 的 LLVM 正在处理这些警告错误。

所以,我明确链接:

ln -sf /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 /usr/bin/cc

于 2012-10-23T20:02:27.203 回答