简体   繁体   English

无法安装 Rails (Windows)

[英]Can't install Rails (Windows )

all day can not understand.整天看不懂。 There are many tips online, but I'm confused.网上有很多提示,但我很困惑。 maybe something wrong edited.也许编辑错了。

help me understand and find the error.帮助我理解并找到错误。

Ruby downloaded here: http://rubyforge.org/frs/?group_id=167&release_id=46722 was established. Ruby 在这里下载: http : //rubyforge.org/frs/? group_id=167&release_id= 46722成立。

then installed gem: http://rubygems.org/pages/download然后安装 gem: http : //rubygems.org/pages/download

then try install Rails,- wrote in concole: gem install rails然后尝试安装 Rails,- 在 concole 中写道: gem install rails

but have error!但有错误! - ——

Error: While executing gem ...错误:执行 gem 时...

Invalid argument - C:/Documents and Settings/Neo/C:无效参数 - C:/Documents and Settings/Neo/C:

this is my concole :这是我的控制台:

C:\\Documents and Settings\\Neo>_ - Does not a long way? C:\\Documents and Settings\\Neo>_ - 不是很远吗?

maybe I must heve only: C:\\>_ ???也许我必须只有: C:\\>_ ??? how I can do it?我该怎么做?

my gem.bat:我的 gem.bat:

@ECHO OFF
SET _HOMEDRIVE=%HOMEDRIVE%
SET _HOMEPATH=%HOMEPATH%
SET HOMEDRIVE=С:
SET HOMEPATH=/Ruby193
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "С:/Ruby193/bin/gem" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"ruby.exe" "%~dpn0" %*
SET HOMEDRIVE=%_HOMEDRIVE%
SET HOMEPATH=%_HOMEPATH%

I either missed something or done something extra ... Thanks!!!我要么错过了一些东西,要么做了一些额外的事情......谢谢!!!

Installing RoR on Windows can be a real challenge when you try to install each piece individually.当您尝试单独安装每个部分时,在 Windows 上安装 RoR 可能是一个真正的挑战。 There is the Rails Installer which will install everything you need.Rails 安装程序,它将安装您需要的一切。 However, if you decide to install everything by yourself you can follow this procedures:但是,如果您决定自己安装所有内容,则可以按照以下步骤操作:

  • Install the ruby language .安装ruby 语言

  • Check if the installation was successful by checking its version:通过检查其版本来检查安装是否成功:

     ruby -v
  • Then you need to check if you can access gem command by checking its version:然后你需要通过检查它的版本来检查你是否可以访问 gem 命令:

     gem -v
  • Update the gem version:更新 gem 版本:

     gem update --system
  • Having the ruby language and the updated gem, you can now instal the Rails:有了 ruby​​ 语言和更新的 gem,你现在可以安装 Rails:

     gem install rails
  • You can check the rails version:您可以检查 rails 版本:

     rails -v
  • Now you need the SQLite database:现在你需要 SQLite 数据库:

     gem install sqlite3-ruby

I was facing error during rails installation in windows >我在windows 中安装 rails 时遇到错误 >

Solution :解决方案 :

Download Ruby+Devkit exe file Install Ruby+Devkit下载 Ruby+Devkit exe 文件 安装 Ruby+Devkit

> ruby -v 
> gem -v
> gem install rails 
> rails -v

All worked !!!!一切都奏效了!!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM