很长一段时间之前 Ruby Rails入门——windows下搭建Ruby Rails Web开发环境 ,由于后来将Ruby的安装文件从 C 盘移动到了 D 盘,也修改了 Path 环境变量,ruby 和 gem 命令都能使用,但是 rails 命令无法使用了,所以执行以下命令重新安装:
gem install rails
却输出以下错误信息:
ERROR: Could not find a valid gem 'rails' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - SSL_connect retur
ned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (
https://api.rubygems.org/specs.4.8.gz)
解决方法:
感兴趣的可以尝试一下,否则请看最后!
执行:
gem sources -a http://rubygems.org
会询问是否添加源
Do you want to add this insecure source? [yn]
输入 y ,然后回车。
进入项目目录,执行:
rails server
提示:
Could not find rake-12.0.0 in any of the sources
Run `bundle install` to install missing gems.
执行
gem install rake
安装 rake。
执行:bundle install
提示:系统找不到指定的路径。
执行:
gem install bundle
安装 bundle。
发现不起作用。
打开 D:\Ruby22-x64\bin 目录,打开 bundle.bat 文件,发现里面的目录还是C盘的,还是不行。
发现很多文件路径都是写死的,改起来太麻烦了,还是重新下载安装包重新安装吧。