2013-03-07 159 views
4

安裝流浪漢寶石當我試圖安裝遊民寶石紅寶石2.0.0-P0,我得到follwoing錯誤:錯誤:紅寶石2.0.0

~ ruby -v 
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux] 
~ gem -v 
2.0.0.rc.2 
~ gem list json 
*** LOCAL GEMS *** 
json (1.7.7) 

~ gem install vagrant 
Building native extensions. This could take a while... 
ERROR: Error installing vagrant: 
    ERROR: Failed to build gem native extension. 

    /home/user_name/.rvm/rubies/ruby-2.0.0-p0/bin/ruby extconf.rb 
checking for ruby/re.h... yes 
checking for ruby/encoding.h... yes 
creating Makefile 
make 
compiling generator.c 
generator.c: In function ‘cState_aref’: 
generator.c:736:5: warning: variable ‘state’ set but not used [-Wunused-but-set-variable] 
linking shared-object json/ext/generator.so 
make install 
/usr/bin/install -c -m 0755 generator.so /home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5/ext/json/ext/json/ext 
/usr/bin/install: cannot create regular file `/home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5/ext/json/ext/json/ext': No such file or directory 
make: *** [install-so] Error 1 
Gem files will remain installed in /home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5 for inspection. 
Results logged to /home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/json-1.5.5/ext/json/ext/generator/gem_make.out 

我的身影,其使用json-1.5.5 from /home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/創建gem並獲取上述錯誤。

我試着重新安裝最新的json-1.7.7 gem,但仍然無法安裝。

回答

7

更新您的RubyGems有:gem update --system

這裏是犯的是修復了這個問題:https://github.com/rubygems/rubygems/commit/1ca11d00833bbca33215ff581303d1fee8f2d1ef

+0

謝謝,我最近安裝的紅寶石2.0.0,並假設其採用了最新的rubygem。有了這個更新,vagrant被成功安裝,並且依賴包括json 1.5.5。 – ranendra 2013-03-14 02:40:59

+0

我使用ruby-2.0.0-p0(與RVM一起安裝),MonngoDB 2.3.3和gem 2.0.0.rc.2,但它不工作... – cortex 2013-04-02 00:08:06

+0

現在,它運行,我運行'gem update - 系統'兩次。謝謝! – cortex 2013-04-02 00:16:59