我跟着this instruction在我的ubuntu 11.04上安装Ruby on Rails,但总是收到此错误消息:
feicun@feicun-ubuntu:~$ gem install rails
Successfully installed rails-3.0.9
1 gem installed
Installing ri documentation for rails-3.0.9...
file 'lib' not found
Installing RDoc documentation for rails-3.0.9...
file 'lib' not found
我搜索了这个问题,这意味着无法构建文档,但安装了rails 3.0.9。为了解决这个问题,我尝试了两种方法:
在rails'文件夹
中创建一个“lib”文件夹sudo mkdir /home/feicun/.rvm/gems/ruby-1.9.2-p290/gems/rails-3.0.9/lib
在安装rails之前运行“gem install rdoc
”
但是这两种方法对我来说都不起作用,这些方法在rails-3.0.9文件夹中仍然没有lib文件夹。
这是我的环境:
feicun@feicun-ubuntu:~$ which ruby
/home/feicun/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
feicun@feicun-ubuntu:~$ which gem
/home/feicun/.rvm/rubies/ruby-1.9.2-p290/bin/gem
feicun@feicun-ubuntu:~$ which rails
/home/feicun/.rvm/gems/ruby-1.9.2-p290/bin/rails
feicun@feicun-ubuntu:~$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.6
- RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [i686-linux]
- INSTALLATION DIRECTORY: /home/feicun/.rvm/gems/ruby-1.9.2-p290
- RUBY EXECUTABLE: /home/feicun/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
- EXECUTABLE DIRECTORY: /home/feicun/.rvm/gems/ruby-1.9.2-p290/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /home/feicun/.rvm/gems/ruby-1.9.2-p290
- /home/feicun/.rvm/gems/ruby-1.9.2-p290@global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
答案 0 :(得分:1)
答案 1 :(得分:0)
sudo mkdir /home/feicun/.rvm/gems/ruby-1.9.2-p290/gems/rails-3.0.9/lib
为什么使用sudo在rvm文件夹中创建目录?我想权限存在一些问题。删除lib文件夹并运行:
mkdir /home/feicun/.rvm/gems/ruby-1.9.2-p290/gems/rails-3.0.9/lib
答案 2 :(得分:0)
我遇到了同样的问题,我所做的只是恢复到之前版本的RubyGems而且一切正常; (我没有深入研究为什么会出现这种情况,但在我确定插入之后它就成了我最初的故障排除解决方案;)