安装rails时找不到文件'lib'

时间:2011-08-22 08:27:52

标签: ruby-on-rails ruby-on-rails-3 installation

类似的东西:

gem install rails
Fetching: activesupport-3.0.10.gem (100%)
Fetching: builder-2.1.2.gem (100%)
WARNING: builder-2.1.2 has an invalid nil value for @cert_chain
Fetching: i18n-0.5.0.gem (100%)
Fetching: activemodel-3.0.10.gem (100%)
Fetching: rack-1.2.3.gem (100%)
Fetching: rack-test-0.5.7.gem (100%)
Fetching: rack-mount-0.6.14.gem (100%)
Fetching: tzinfo-0.3.29.gem (100%)
Fetching: abstract-1.0.0.gem (100%)
WARNING: abstract-1.0.0 has an invalid nil value for @cert_chain
Fetching: erubis-2.6.6.gem (100%)
Fetching: actionpack-3.0.10.gem (100%)
Fetching: arel-2.0.10.gem (100%)
Fetching: activerecord-3.0.10.gem (100%)
Fetching: activeresource-3.0.10.gem (100%)
Fetching: mime-types-1.16.gem (100%)
Fetching: polyglot-0.3.2.gem (100%)
Fetching: treetop-1.4.10.gem (100%)
Fetching: mail-2.2.19.gem (100%)
Fetching: actionmailer-3.0.10.gem (100%)
Fetching: thor-0.14.6.gem (100%)
Fetching: railties-3.0.10.gem (100%)
Fetching: bundler-1.0.18.gem (100%)
Fetching: rails-3.0.10.gem (100%)
Successfully installed activesupport-3.0.10
Successfully installed builder-2.1.2
Successfully installed i18n-0.5.0
Successfully installed activemodel-3.0.10
Successfully installed rack-1.2.3
Successfully installed rack-test-0.5.7
Successfully installed rack-mount-0.6.14
Successfully installed tzinfo-0.3.29
Successfully installed abstract-1.0.0
Successfully installed erubis-2.6.6
Successfully installed actionpack-3.0.10
Successfully installed arel-2.0.10
Successfully installed activerecord-3.0.10
Successfully installed activeresource-3.0.10
Successfully installed mime-types-1.16
Successfully installed polyglot-0.3.2
Successfully installed treetop-1.4.10
Successfully installed mail-2.2.19
Successfully installed actionmailer-3.0.10
Successfully installed thor-0.14.6
Successfully installed railties-3.0.10
Successfully installed bundler-1.0.18
Successfully installed rails-3.0.10
23 gems installed
Installing ri documentation for activesupport-3.0.10...
Installing ri documentation for builder-2.1.2...
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README, skipping
Installing ri documentation for i18n-0.5.0...
Installing ri documentation for activemodel-3.0.10...
Installing ri documentation for rack-1.2.3...
Installing ri documentation for rack-test-0.5.7...
Installing ri documentation for rack-mount-0.6.14...
Installing ri documentation for tzinfo-0.3.29...
Installing ri documentation for abstract-1.0.0...
Installing ri documentation for erubis-2.6.6...
Installing ri documentation for actionpack-3.0.10...
Installing ri documentation for arel-2.0.10...
Installing ri documentation for activerecord-3.0.10...
Installing ri documentation for activeresource-3.0.10...
Installing ri documentation for mime-types-1.16...
Installing ri documentation for polyglot-0.3.2...
Installing ri documentation for treetop-1.4.10...
Installing ri documentation for mail-2.2.19...
Installing ri documentation for actionmailer-3.0.10...
Installing ri documentation for thor-0.14.6...
Installing ri documentation for railties-3.0.10...
Installing ri documentation for bundler-1.0.18...
Installing ri documentation for rails-3.0.10...
file 'lib' not found
Installing RDoc documentation for activesupport-3.0.10...
Installing RDoc documentation for builder-2.1.2...
unable to convert "\xF1" from ASCII-8BIT to UTF-8 for README, skipping
Installing RDoc documentation for i18n-0.5.0...
Installing RDoc documentation for activemodel-3.0.10...
Installing RDoc documentation for rack-1.2.3...
Installing RDoc documentation for rack-test-0.5.7...
Installing RDoc documentation for rack-mount-0.6.14...
Installing RDoc documentation for tzinfo-0.3.29...
Installing RDoc documentation for abstract-1.0.0...
Installing RDoc documentation for erubis-2.6.6...
Installing RDoc documentation for actionpack-3.0.10...
Installing RDoc documentation for arel-2.0.10...
Installing RDoc documentation for activerecord-3.0.10...
Installing RDoc documentation for activeresource-3.0.10...
Installing RDoc documentation for mime-types-1.16...
Installing RDoc documentation for polyglot-0.3.2...
Installing RDoc documentation for treetop-1.4.10...
Installing RDoc documentation for mail-2.2.19...
Installing RDoc documentation for actionmailer-3.0.10...
Installing RDoc documentation for thor-0.14.6...
Installing RDoc documentation for railties-3.0.10...
Installing RDoc documentation for bundler-1.0.18...
Installing RDoc documentation for rails-3.0.10...
file 'lib' not found

如果我运行rake db:migrate

它说:

  ............
    rake aborted!

stack level too deep

5 个答案:

答案 0 :(得分:11)

试试这个:

sudo gem install rails --no-ri --no-rdoc

如果你想安装RDoc,请使用:

sudo gem install rdoc-data
sudo rdoc-data --install
sudo gem rdoc --all --overwrite

如果不起作用,请尝试:

sudo apt-get install ruby-dev build-essential

答案 1 :(得分:5)

注意,以下内容似乎也适用于Windows 7.(省略“sudo”)

gem install rails --no-ri --no-rdoc

答案 2 :(得分:5)

我与gem install rails(Ubuntu 12.04,带有RVM)

类似
Installing ri documentation for rails-3.2.13...
file 'lib' not found
Installing RDoc documentation for rails-3.2.13...
file 'lib' not found

安装RDoc然后重新安装rails解决了我的问题。所以:

gem install rdoc
gem install rails

答案 3 :(得分:2)

这仍然发生在rails-3.2.3上。

似乎可行的是首先安装rdoc。因此,使用新安装的红宝石,请执行:

gem install rdoc gem install rails

答案 4 :(得分:0)

似乎ree和ruby 1.8存在一些问题。。如果您有rvm,请尝试使用ruby 1.9.2或任何1.9。

然后

gem install rails将起作用