我安装了 Ruby-on-Rails,但它是 Ruby 版本 1.9.3。它是通过 Railsinstaller 安装的。因为我刚开始使用 RoR,所以我想从最新版本开始学习 Ruby on Rails 教程。Rails 很容易更新,但不是 Ruby 本身。
我卸载了现有的 RailsInstaller,删除了 c:\Railsinstaller 目录并下载了最新版本的 RailsInstaller,版本 3.0.0-alpha.1。
安装后,它会启动一个命令提示符窗口,该窗口应列出 git、ruby 和 rails 的安装信息。相反,我收到了这个错误:
The system cannot find the path specified.
Rails Environment Configuration.
C:/RailsInstaller/scripts/config_check.rb:28:in ``': No such file or directory -
rails -v (Errno::ENOENT)
from C:/RailsInstaller/scripts/config_check.rb:28:in `run'
from C:/RailsInstaller/scripts/config_check.rb:83:in `<main>'
C:\Sites>
第 28 行是此块的一部分:
def run(command)
$stderr.puts "Running #{command}" if Config[:debug]
%x{#{command}}.chomp
end
第 83 行是“puts”块的内部:
version: #{run "rails -v"}
手动运行“rails -v”
C:\Sites>rails -v
'rails' is not recognized as an internal or external command,
operable program or batch file.
尝试“ruby rails.rb” ruby:没有这样的文件或目录 -- rails.rb (LoadError)
尝试手动安装 rails gem
c:\Sites>gem install rails --version 4.0.0
Fetching: i18n-0.6.4.gem (100%)
Successfully installed i18n-0.6.4
Fetching: atomic-1.1.10.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
The system cannot find the path specified.
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
C:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb
creating Makefile
Gem files will remain installed in C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0
.0/gems/atomic-1.1.10 for inspection.
Results logged to C:/RailsInstaller/Ruby2.0.0/lib/ruby/gems/2.0.0/gems/atomic-1.
1.10/ext/gem_make.out
gem_make.out 仅包含:
C:/RailsInstaller/Ruby2.0.0/bin/ruby.exe extconf.rb
creating Makefile
我尝试在 windows xp 机器上安装 Railsinstaller 3.0.0 进行测试,安装后出现同样的错误,运行“rails -v”以同样的方式失败,但运行“gem install rails --version 4.0.0”工作。
以前的安装是否存在导致新安装无法正常运行的问题?
我认为某些东西仍在尝试转到 Ruby1.9.3 forlder 和/或子文件夹并失败,但找不到任何引用该目录的内容。