热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

安装后没有显示Rubyjsongem-Rubyjsongemnotshowingafterinstall

SoIinstalledthejsongemusing:所以我使用以下命令安装了jsongem:sudogeminstalljsonEverythingappeare

So I installed the json gem using:

所以我使用以下命令安装了json gem:

sudo gem install json

Everything appeared to install correctly, but when I call gem list I get this:

一切似乎安装正确,但当我打电话给宝石列表我得到这个:

bundler (1.2.1)
hpricot (0.8.6)
i18n (0.6.1)
mail (2.4.4)
mime-types (1.19)
polyglot (0.3.3)
rack (1.4.1)
rack-protection (1.2.0)
rake (10.0.0)
rubygems-bundler (1.1.0)
rvm (1.11.3.5)
sinatra (1.3.3)
tilt (1.3.3)
treetop (1.4.12)

As you can see there is no json gem, and it is making it so I can run my Ruby Program. Any help would be great!

正如你所看到的,没有json gem,它正在制作它,所以我可以运行我的Ruby程序。任何帮助都会很棒!

2 个解决方案

#1


3  

You installed JSON using sudo but it appears you're running RVM. Under RVM, using sudo to install gems, is a big NO-NO and causes this sort of problem.

您使用sudo安装了JSON,但看起来您正在运行RVM。在RVM下,使用sudo来安装gem,是一个很大的NO-NO并导致这类问题。

sudo gem install json installed it over the pre-existing JSON in your system, not into the RVM-controlled Ruby.

sudo gem install json将它安装在系统中预先存在的JSON上,而不是安装在RVM控制的Ruby中。

Do it again, but do NOT use sudo and see what happens.

再做一次,但不要使用sudo,看看会发生什么。

And, unless you understand what's happening with sudo gem install json or some other gem, don't use sudo gem install or sudo gem remove.

而且,除非你了解sudo gem install json或其他一些gem发生了什么,否则不要使用sudo gem install或sudo gem remove。

EDIT:

Per the Troubleshooting page on RVM's site, here's how to remove the system-wide installation:

根据RVM站点上的“故障排除”页面,以下是如何删除系统范围的安装:

#!/bin/bash
/usr/bin/sudo rm -rf $HOME/.rvm $HOME/.rvmrc /etc/rvmrc /etc/profile.d/rvm.sh /usr/local/rvm /usr/local/bin/rvm
/usr/bin/sudo /usr/sbin/groupdel rvm
/bin/echo "RVM is removed. Please check all .bashrc|.bash_profile|.profile|.zshrc for RVM source lines and delete
or comment out if this was a Per-User installation."

#2


0  

If you need sudo permissions to install a gem you should use: rvmsudo

如果您需要sudo权限来安装gem,您应该使用:rvmsudo

In this case, it fixed my problem without having to reinstall everything.

在这种情况下,它解决了我的问题,而无需重新安装所有内容。


推荐阅读
author-avatar
mobiledu2502878243
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有