Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
什么';这个Ruby依赖项有什么问题?_Ruby_Swagger - Fatal编程技术网

什么';这个Ruby依赖项有什么问题?

什么';这个Ruby依赖项有什么问题?,ruby,swagger,Ruby,Swagger,我正在尝试在OSX 10.7.5上使用 它取决于“json”,所以我正在安装它,然后尝试如下运行 machine:source2swagger jpbeuc1$ sudo gem install json Password: Building native extensions. This could take a while... Successfully installed json-1.7.7 1 gem installed Installing ri documentation for

我正在尝试在OSX 10.7.5上使用

它取决于“json”,所以我正在安装它,然后尝试如下运行

machine:source2swagger jpbeuc1$ sudo gem install json
Password:
Building native extensions.  This could take a while...
Successfully installed json-1.7.7
1 gem installed
Installing ri documentation for json-1.7.7...
Installing RDoc documentation for json-1.7.7...
machine:source2swagger jpbeuc1$ bin/source2swagger 
bin/source2swagger:4:in `require': no such file to load -- json (LoadError)
    from bin/source2swagger:4

有谁能告诉我什么不起作用,以及如何让source2swagger看到“json”

您的
本地
中安装了
source2swagger
,而
gems
则安装在
中。因此,需要
json
source2swager
无法访问安装在
root
中的gem。因此,我建议始终在
local
中安装gems,并避免使用
sudo
安装gems。要在本地管理gem,我建议使用。

尝试
gem install json
不要使用
sudo
machine:source2swagger jpbeuc1$gem install json错误:执行gem时。。。(Gem::FilePermissionError)您没有写入/Library/Ruby/Gems/1.8目录的权限。您的Gem路径是什么?do
echo$GEM_PATH
我认为您有
source2swager
访问用户级别的权限,
GEM
位于根级别。因此,
source2swager
无法找到您的
json
gem。因此,在
主页安装gems
您的系统上是否安装了
rvm
?建议我安装rvm,source2swagger在安装后工作。