加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

错误:在ruby 2.0.0中安装vagrant gem

发布时间:2020-12-17 02:45:01 所属栏目:百科 来源:网络整理
导读:当我尝试在 ruby 2.0.0-p0中安装vagrant gem时,我遇到了以下错误: ~ ruby -vruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-linux]~ gem -v2.0.0.rc.2~ gem list json*** LOCAL GEMS ***json (1.7.7)~ gem install vagrantBuilding native extensions.
当我尝试在 ruby 2.0.0-p0中安装vagrant gem时,我遇到了以下错误:

~ 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

我想,它在构建gem并获得上述错误时使用/home/user_name/.rvm/gems/ruby-2.0.0-p0/gems/中的json-1.5.5.

我尝试重新安装最新的json-1.7.7 gem,但仍然无法安装.

解决方法

使用:gem update –system更新你的rubygems

以下是解决此问题的提交:https://github.com/rubygems/rubygems/commit/1ca11d00833bbca33215ff581303d1fee8f2d1ef

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读