gem sources taobao添加失败 bad response

解决国内gem不能用的问题
时间: 20:02:33
&&&& 阅读:2106
&&&& 评论:
&&&& 收藏:0
标签:转自:http://www.haorooms.com/post/gem_not_use
最近在安装SASS的时候,用到gem命令,但是运行出行如下错误!
C:\Users\len&gem install sass
While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ETIMEDOUT: A connection attempt failed because the connected party di
d not properly respond after a period of time, or established connection failed
because connected host has failed to respond. - connect(2) for "rubygems.global.
ssl.fastly.net" port 443 (https://api.rubygems.org/quick/Marshal.4.8/sass-3.4.13
.gemspec.rz)
原因是ruby 的gem被和谐了,现在淘宝的ruby工程师架设了rubygems的国内镜像。使用方法如下:
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org
然后在运行gem命令就可以了!
C:\Users\len&gem install sass
Fetching: sass-3.4.13.gem (100%)
Successfully installed sass-3.4.13
Parsing documentation for sass-3.4.13
Installing ri documentation for sass-3.4.13
Done installing documentation for sass after 5 seconds
1 gem installed
关于sass入门教程请看:标签:原文地址:http://www.cnblogs.com/netfork/p/5114195.html
&&国之画&&&& &&&&chrome插件&&
版权所有 京ICP备号-2
迷上了代码!解决国内gem不能用的问题
37537次浏览
最近在安装SASS的时候,用到gem命令,但是运行出行如下错误!
C:\Users\len&gem install sass
While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ETIMEDOUT: A connection attempt failed because the connected party di
d not properly respond after a period of time, or established connection failed
because connected host has failed to respond. - connect(2) for &rubygems.global.
ssl.fastly.net& port 443 (https://api.rubygems.org/quick/Marshal.4.8/sass-3.4.13
.gemspec.rz)
原因是ruby 的gem被和谐了,现在淘宝的ruby工程师架设了rubygems的国内镜像。使用方法如下:
$ gem sources --remove https://rubygems.org/
$ gem sources -a https://ruby.taobao.org/
$ gem sources -l
*** CURRENT SOURCES ***
https://ruby.taobao.org
然后在运行gem命令就可以了!
C:\Users\len&gem install sass
Fetching: sass-3.4.13.gem (100%)
Successfully installed sass-3.4.13
Parsing documentation for sass-3.4.13
Installing ri documentation for sass-3.4.13
Done installing documentation for sass after 5 seconds
1 gem installed
关于sass入门教程请看:
相关文章:
关键词搜索CocoaPods 安装 使用
1.开启 terminal
2.移除现有 Ruby 默认源
$ gem sources --remove https://rubygems.org/
3.使用新的源
$ gem sources -a https://ruby.taobao.org/
4.验证新源是否替换成功
$ gem sources -l
5.安装 CocoaPods
$ sudo gem install cocoapods
$ pod setup
备注:苹果系统升级&OS X EL Capitan 后安装改为:
$ sudo gem install -n /usr/local/bin cocoapods
$ pod setup
6.更新 gem
$ sudo gem update --system
7.新建工程,并在终端用 cd 指令到文件夹内
$ pod search 第三方
8.新建 Podfile 文件
$ touch Podfile
9.编辑 Podfile 文件,并写入要添加的第三方库
platform:ios, '8.0'
pod 'AFNetworking', '~& 2.3.1'&-------第三方
10.导入第三方库
$ pod install
11.退出终端
可能遇到的错误提示及解决方法:
Error fetching http://ruby.taobao.org/:
bad response Not Found 404 (http://ruby.taobao.org/specs.4.8.gz)
解决方案:把安装流程中&$ gem sources -a http://ruby.taobao.org/&
改为:$ gem sources -a https://ruby.taobao.org/
ERROR:& While executing gem ... (Errno::EPERM)
Operation not permitted - /usr/bin/pod
解决方案:苹果系统升级&OS X EL Capitan 后会出现的插件错误,将安装流程 5.安装 CocoaPods 的&sudo gem install cocoapods
改为&sudo gem install -n /usr/local/bin cocoapods
[!] Unable to satisfy the following requirements:
- `AFNetworking (~& 2.3.1)` required by `Podfile`
Specs satisfying the `AFNetworking (~& 2.3.1)` dependency were found, but they required a higher minimum deployment target.
解决方案:Podfile 文件 中 &&platform:ios,&&8.0&&&后边的 8.0 是平台版本号 ,一定要加上
――――――――――&MARKDOWN TEMPLATE ――――――――――
### Report
* What did you do?
* What did you expect to happen?
* What happened instead?
CocoaPods : 0.29.0
Ruby : ruby 2.0.0p247 ( revision 41674) [universal.x86_64-darwin13]
RubyGems : 2.1.11
Host : Mac OS X 10.9.2 (13C64)
Xcode : 5.1 (5B130a)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib
Repositories : master - https://github.com/CocoaPods/Specs.git @ bdc98ab7a1dae04697cae002f25a9b
### Podfile
platform :ios,'8.0'
pod 'MBProgressHUD', '~& 0.8'
Psych::SyntaxError - (/Users/MAXJ/.cocoapods/repos/master/CocoaPods-version.yml): mapping values are not allowed in this context at line 3 column 4
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:205:in `parse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:205:in `parse_stream'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:153:in `parse'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:129:in `load'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:299:in `block in load_file'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:299:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/psych.rb:299:in `load_file'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/sources_manager.rb:261:in `version_information'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/sources_manager.rb:222:in `repo_compatible?'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/sources_manager.rb:281:in `master_repo_functional?'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:39:in `parse'
/Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:179:in `parse'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:38:in `parse'
/Library/Ruby/Gems/2.0.0/gems/claide-0.4.0/lib/claide/command.rb:211:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/lib/cocoapods/command.rb:51:in `run'
/Library/Ruby/Gems/2.0.0/gems/cocoapods-0.29.0/bin/pod:24:in `'
/usr/bin/pod:23:in `load'
/usr/bin/pod:23:in `'
――――――――――&TEMPLATE END ――――――――――
[!] Oh no, an error occurred.
Search for existing github issues similar to yours:
https://github.com/CocoaPods/CocoaPods/search?q=%28%2FUsers%2FMAXJ%2F.cocoapods%2Frepos%2Fmaster%2FCocoaPods-version.yml%29%3A+mapping+values+are+not+allowed+in+this+context+at+line+3+column+4&type=Issues
If none exists, create a ticket, with the template displayed above, on:
https://github.com/CocoaPods/CocoaPods/issues/new
Don't forget to anonymize any private data!
解决方案:
$ sudo rm -rf ~/.cocoapods/repos/master
$ pod setup
&---- 完-----
阅读(...) 评论()他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)

我要回帖

更多关于 gem sources 的文章

 

随机推荐