2011-01-07 58 views
0

我有我的ruby环境启动并运行(通过RubyInstaller获取)。 每当我试着用下面的命令来安装导轨:在Windows中安装Rails 3

gem install --http-proxy http://localhost:3128 rails --debug -V 

我开始越来越错误,所以我不能安装它:

Exception `NameError' at C:/Ruby192/lib/ruby/1.9.1/rubygems/command_manager.rb:164 - uninitialized constant Gem::Commands::InstallCommand 
Exception `NameError' at C:/Ruby192/lib/ruby/1.9.1/syck/tag.rb:81 - method `yaml_as' not defined in Module 
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 - 
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 - 
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 - 
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 - 
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 - 
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 - 
Exception `Interrupt' at <internal:lib/rubygems/custom_require>:29 - 
ERROR: Loading command: install (Interrupt) 

     <internal:lib/rubygems/custom_require>:29:in `require' 
     <internal:lib/rubygems/custom_require>:29:in `require' 
     C:/Ruby192/lib/ruby/1.9.1/rubygems/package.rb:92:in `<top (required)>' 
     <internal:lib/rubygems/custom_require>:29:in `require' 
     <internal:lib/rubygems/custom_require>:29:in `require' 
     C:/Ruby192/lib/ruby/1.9.1/rubygems/format.rb:9:in `<top (required)>' 
     <internal:lib/rubygems/custom_require>:29:in `require' 
     <internal:lib/rubygems/custom_require>:29:in `require' 
     C:/Ruby192/lib/ruby/1.9.1/rubygems/installer.rb:10:in `<top (required)>' 

     <internal:lib/rubygems/custom_require>:29:in `require' 
     <internal:lib/rubygems/custom_require>:29:in `require' 
     C:/Ruby192/lib/ruby/1.9.1/rubygems/dependency_installer.rb:3:in `<top (required)>' 
     <internal:lib/rubygems/custom_require>:29:in `require' 
     <internal:lib/rubygems/custom_require>:29:in `require' 
     C:/Ruby192/lib/ruby/1.9.1/rubygems/commands/install_command.rb:4:in `<top (required)>' 
     <internal:lib/rubygems/custom_require>:29:in `require' 
     <internal:lib/rubygems/custom_require>:29:in `require' 
     C:/Ruby192/lib/ruby/1.9.1/rubygems/command_manager.rb:170:in `rescue in load_and_instantiate' 

[..]

谁能帮助?谢谢

+0

你有没有试过简单的一个: - “gem install rails”? – 2011-01-07 10:26:33

+0

是的,但我后面的代理,所以我必须设置它,并且因为它挂起,我激活了调试选项。在其核心,它是阵风“宝石安装轨道” – pistacchio 2011-01-07 10:33:10

回答

0

离开了--http-proxy部分,然后再试一次, 我也有过这个问题的多个问题。

将http_proxy添加到Windows的系统属性中的系统变量 在XP中:右键单击开始菜单中的我的电脑,然后单击高级 - >环境变量。

0

这不是直接回答这个问题,而是尝试了像InstantRails,RubyStack等方法,我发现这些只是一个额外的层面维护 - 而且我从来没有真正的知道封面下面发生了什么。此外,我必须等待项目维护人员发布更新以获得最新和最好的更新。最后,这绝不代表生产环境,这意味着我必须学习一套全新的优化技术,以适应生产时间。

这里有一些想法/建议则:

你打算在Windows环境中部署?如果没有,我会建议/建议设置一个运行Linux的虚拟机(例如VirtualBox)(Ubuntu是我的首选)。您可以轻松运行512MB或更低的RoR + db环境。

然后,您可以通过启用Samba(用于开发目的)从Windows窗口访问文件系统,以便使用您最喜爱的Windows IDE工具。要启动/停止服务器,运行迁移等,只需使用终端对实例。

有这种方法有很多优点:

  1. Ruby和Rails是显著快上的Linux
  2. 假设这是你的目标部署环境,这将是从开发一个简单的过渡催促
  3. 保持Ruby和Rails与Windows分离也有助于保持Windows运行的清洁。更低的RAM使用率,更清洁的磁盘,您可以根据需要通过启动/关闭VM来打开/关闭RoR实例。