使用gem命令时出现的几种错误
2016-03-23 11:42
232 查看
在终端用gem命令的时候,时常遇到的问题:
墙墙墙
通过 gem source 查看你的当前的gem资源库位置,如果你的当前资源库的位置为: https://rubygems.org/,不好意思,你是无法安装成功的,因为这个资源库在国外,所以你需要安装的githug是无法下载成功的,那我们怎么办呢,其实方法很简单,修改当前资源库的位置:
1- gem sources -r https://rubygems.org/ 删除原来的资源库位置
2- gem sources -a https://ruby.taobao.org/ 添加新的资源库位置
3- gem sources -u 更新资源库
目录权限不够
报错:
ERROR: While executing gem … (Gem::FilePermissionError) You don’t have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
解决:
sudo chmod 777 /Library/Ruby/Gems/2.0.0 修改权限
gem需要更新
报错:
ERROR: While executing gem … (Errno::EACCES)
Permission denied - /Library/Ruby/Gems/2.0.0/cache/i18n-0.7.0.gem
解决:
gem update –system
如果还是不行,又想用gem安装怎么办?sudo gem install….
墙墙墙
通过 gem source 查看你的当前的gem资源库位置,如果你的当前资源库的位置为: https://rubygems.org/,不好意思,你是无法安装成功的,因为这个资源库在国外,所以你需要安装的githug是无法下载成功的,那我们怎么办呢,其实方法很简单,修改当前资源库的位置:
1- gem sources -r https://rubygems.org/ 删除原来的资源库位置
2- gem sources -a https://ruby.taobao.org/ 添加新的资源库位置
3- gem sources -u 更新资源库
目录权限不够
报错:
ERROR: While executing gem … (Gem::FilePermissionError) You don’t have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
解决:
sudo chmod 777 /Library/Ruby/Gems/2.0.0 修改权限
gem需要更新
报错:
ERROR: While executing gem … (Errno::EACCES)
Permission denied - /Library/Ruby/Gems/2.0.0/cache/i18n-0.7.0.gem
解决:
gem update –system
如果还是不行,又想用gem安装怎么办?sudo gem install….
相关文章推荐
- ruby安装gem包失败的通用解决方法
- Ruby包管理器gem常用命令
- 学习Ruby你需要了解的相关知识(rvm, gem, bundle, rake, rails等)
- Ruby学习笔记之gem 命令详解
- Rails bundle命令安装mysql gem包出错的解决方法
- Linux中安装MySQL 2.8.1 gem
- 设置 git/npm/bower/gem 镜像或代理的方法
- rails gem列表大全及介绍
- 将自己写的gem发布到rubygems
- 关于CocoaPod无法升级以及无法下载第三方库和Cocoapods在OS X 10.11系统上的无法正常使用的问题
- devise+cancancan+rolify入门
- 安装Ruby On Rails时运行“gem install rails”没有反应怎么办?
- Ubuntu搭建Cloud9 IDE笔记——安装Node.js npm Cloud9
- CocoaPods安装和使用教程
- 安装或者更换cocoapods版本出现的问题
- windows 下安装部分gem时出现 Could not create Makefile due to some reason 的解决办法
- Ubuntu14.04上搭建ruby on rails 环境全过程
- cocoapods sources
- passenger安装nginx