2013-02-26 86 views
0

我試圖根據http://lenni.info/blog/2012/05/installing-ruby-1-9-3-on-ubuntu-12-04-precise-pengolin/將我的ruby版本從1.8(默認)切換到1.9.3(Pangolin的最新版本)。我正在使用apt進行此操作。ruby​​升級之後:無法構建gem原生擴展。 (EC2 Ubuntu)

有關SO的相關問題的其他解決方案涉及apt-get install ruby1.9.3-dev但我肯定擁有它。

$ sudo gem install idn 
Building native extensions. This could take a while... 
ERROR: Error installing idn: 
     ERROR: Failed to build gem native extension. 

     /usr/bin/ruby1.9.1 extconf.rb 
checking for main() in -lidn... yes 
checking for idna.h... yes 
checking for punycode.h... yes 
checking for stringprep.h... yes 
creating Makefile 

make 
compiling idn.c 
compiling idna.c 
idna.c: In function ‘toASCII’: 
idna.c:88:37: error: ‘struct RString’ has no member named ‘ptr’ 
idna.c: In function ‘toUnicode’: 
idna.c:128:41: error: ‘struct RString’ has no member named ‘ptr’ 
make: *** [idna.o] Error 1 


Gem files will remain installed in /var/lib/gems/1.9.1/gems/idn-0.0.2 for inspection. 
Results logged to /var/lib/gems/1.9.1/gems/idn-0.0.2/ext/gem_make.out 

我也檢查了我安裝了gcc和它再次從apt安裝。

$ ruby -v 
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] 
+0

我猜你錯過了一些標題。在編譯Ruby或IDN時。也許'zlib1g-dev'。 – harm 2013-02-26 19:26:36

+0

@harm謝謝!讓我試試看。 ...'zlib1g-dev已經是最新的版本了。'嗯。 – isomorphismes 2013-02-26 19:33:12

+1

這聽起來像寶石只是不兼容Ruby 1.9(這改變了你如何從C擴展訪問字符串數據) – 2013-02-27 01:21:26

回答

1

我可以放棄這個。我能夠安裝punycode4r寶石,並且適用於我正在嘗試做的事。

相關問題