在Lion下搭建Rails环境遇挫, 求救!

2011-10-04 17:57:30 +08:00
 spark
http://ruby.railstutorial.org/

还是按照书中内容全新安装git, rvm, 用rvm安装ruby 1.9.2, 都正常.

奇怪的问题来了, gem install rails 死活也安装不上, google了很多方法都不能解决.

gem install rails --debug

<pre>
Exception `NameError' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::InstallCommand
Exception `Gem::LoadError' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247 - Could not find psych (>= 1.2.1, ~> 1.2) amongst []
Exception `OptionParser::MissingArgument' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/optparse.rb:458 - missing argument:
Exception `OptionParser::MissingArgument' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/optparse.rb:1311 - missing argument: -i
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EAGAIN' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/net/protocol.rb:135 - Resource temporarily unavailable - read would block
Exception `Errno::EEXIST' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/fileutils.rb:243 - File exists - /Users/username/.gem/specs/gems.github.com%80
Exception `Gem::GemNotFoundException' at /Users/username/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/dependency_installer.rb:237 - Could not find a valid gem 'rails' (>= 0) locally or in a repository
ERROR: Could not find a valid gem 'rails' (>= 0) in any repository
</pre>
6262 次点击
所在节点    Ruby on Rails
25 条回复
daqing
2011-10-04 18:07:51 +08:00
安装一下psych: gem install psych
AntiGameZ
2011-10-04 18:13:57 +08:00
说白了还是gfw作祟
spark
2011-10-04 18:14:18 +08:00
感谢楼上的回复,psych安装也出现类似上边的错误。
spark
2011-10-04 18:16:08 +08:00
@AntiGameZ 我看了李华顺的文章,可能是你说的问题导致.
http://huacnlee.com/blog/using-nginx-proxy-to-mirror-rubygem-org

想请问有没有什么解决方案呢?实在不想把假期浪费掉啊
AntiGameZ
2011-10-04 18:20:43 +08:00
@spark 不用李华顺的方案的话,两条路,自己搭建一个gems(李在文章里也说到了);或者去rubygems网站上,把要用的都给下下来。

不过自己想了下,似乎可以通过改hosts的方式绕开gfw,但是目前没力气去尝试。
Livid
2011-10-04 18:30:07 +08:00
rubygems.org 上是否存在什么特别敏感的东西么?

如果不存在的话,我倒是可以为它搭建一个反向代理并且在 V2EX DNS 上做一些特殊设置,这样只要使用 V2EX DNS 即可正常安装 gems 了。
Livid
2011-10-04 18:32:46 +08:00
不知为什么 @huacnlee 之前提供的 184.82.37.134 现在无法访问了呢?
AntiGameZ
2011-10-04 18:38:34 +08:00
@Livid 干吧,我带头第一个用
spark
2011-10-04 18:53:40 +08:00
@Livid 华顺提供的那个ip确实是不能用了,但是确实想不通rubygems.org有什么敏感的东西。

目前正在用最笨的办法, 手动从rubygems挨个下载gem, 唉
pepsin
2011-10-04 19:06:07 +08:00
@spark rubygem用的好像是amazon的服务器,被墙了一些,今天专门买了个vpn解决了这问题。郁闷啊
Livid
2011-10-04 19:09:19 +08:00
嗯,加入 Todo 列表。今晚看完 Apple 发布会后试验。
jeuxee
2011-10-04 19:54:07 +08:00
我也遇到过问题,不过不是这种提示,也没用rvm。我的问题是Lion默认用LLVM替换了GCC引起的,安装时指定用GCC 4.3就顺利了。
Andor_Chen
2011-10-04 20:28:16 +08:00
@livid 强烈支持

每次安装 gem 都要挂 VPN 有点不爽
cngithub
2011-10-04 20:30:58 +08:00
是gfw的问题。昨晚用家里的宽带,连rvm install 1.9.2都无法执行,提示找不到文件。换了vpn,没问题了。
huacnlee
2011-10-05 10:22:27 +08:00
@Livid 那个服务挂了...找不会来了,打家可以直接搞个跳板, 参见:
http://huacnlee.com/blog/using-nginx-proxy-to-mirror-rubygem-org
spark
2011-10-05 11:22:12 +08:00
@cngithub @Andor_Chen 我尝试挂vpn也不行

期待@Livid的实验结果^_^
pepsin
2011-10-08 15:44:21 +08:00
rvm install 1.9.2 碰上 “There has been an error while trying to fetch the source” ,有人知道怎么解决么?Vpn 我们这也挂不上了。。。
roamlog
2011-10-09 09:07:58 +08:00
不知道 @livid 有没实验成功?
linsk
2011-10-09 10:13:39 +08:00
注意你的gem版本,前阵子我装的时候1.8.6和最新的1.8.8均出错~最后用了1.8.7解决问题。
flyingkid
2011-10-15 11:49:50 +08:00
搞个vpn,或者自己把rails下回来,本地装。
我建议弄个vpn。
弄到本地来弄太折腾了。
而且我发现install rails完全比人品的。
我之前用v2ex dns成功安装过一次,后来升级到lion以后就在也没有成功了。
我最后用vpn搞定了,几分钟就解决问题了。法克法克。。。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/18968

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX