2012-04-05 50 views
1

我試圖使用​​寶石。如果我嘗試加載在require 'fuzzystringmatch'irb和類型我得到所有這些錯誤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); 

難道我做錯了什麼?我沒有改變代碼或任何東西。我將如何解決這個問題?有沒有人來解決這個問題?

+0

什麼版本的Ruby您使用的是? – Alex 2012-04-05 18:52:08

+0

紅寶石版本v1.9.3 – Akshat 2012-04-05 18:52:36

+0

它必須執行1.9.3(它顯示錯誤的路徑),因爲我有1.8.7旁邊我切換到,但絕對設置爲1.9.3 – Akshat 2012-04-05 18:52:59

回答

1

我通過將/ usr/bin/cc鏈接到/ usr/bin/gcc的sym解決了我的問題。我在Mountain Lion,而蘋果的LLVM正在處理那些警告錯誤。

所以,我explicty鏈接:

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