在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>
6263 次点击
所在节点    Ruby on Rails
25 条回复
victor
2011-10-31 06:55:32 +08:00
我覺得樓上說的是最好的辦法,VPN的價格一般在10元/月以內,除了安裝Gem方便,搭配Firefox的AutoProxy去Google查資料也方便。

能花幾塊錢解決的問題,就不要浪費時間自己折騰了。:)
stranbird
2011-10-31 09:44:01 +08:00
楼主应该已经装好了..

但是还是说一下,仿佛装1.9.2之前必须装1.8.7的。
spark
2011-10-31 11:49:09 +08:00
确实早已装好,VPN和SSH都买了,结果发现和网络的关系不大。

解决方案是用rvm把该装的pkg都安装上,然后重新编译安装1.9.2
Readline
IConv
Zlib
OpenSSL
Autoconf
spark
2011-10-31 11:51:49 +08:00
补充一点,我发这个贴子时的出错原因貌似是因为没有安装readline和openssl。

@stranbird 提到的这点确实是很多用rvm的新手可能会很头痛的问题。
marco
2011-10-31 12:01:01 +08:00
永远都在 VPN 的保护下,从来没遇到过问题。记得要开启所有流量走 VPN 。

大家如果嫌 VPN 状态下连国内服务器慢,就用 http://code.google.com/p/chnroutes/ 把连接国内服务器设置走本地就好。

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

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

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

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

© 2021 V2EX