Ruby on Rails安装:config.gem无法识别

时间:2012-03-21 23:47:35

标签: ruby-on-rails

安装了rubyinstaller-1.8.7-p358.exe,然后尝试安装jammit,但无法识别config.gem命令。有趣的是,我的驱动器上没有名为 environment.rb 的文件。

我也从未使用过红宝石:D


H:\>gem install jammit
Fetching: Platform-0.4.0.gem (100%)
WARNING: Platform-0.4.0 has an invalid nil value for @cert_chain
Fetching: open4-1.3.0.gem (100%)
Fetching: POpen4-0.1.4.gem (100%)
Fetching: yui-compressor-0.9.6.gem (100%)
Fetching: jammit-0.6.5.gem (100%)
Successfully installed Platform-0.4.0
Successfully installed open4-1.3.0
Successfully installed POpen4-0.1.4
Successfully installed yui-compressor-0.9.6
Successfully installed jammit-0.6.5
5 gems installed
Installing ri documentation for Platform-0.4.0...
Installing ri documentation for open4-1.3.0...
Installing ri documentation for POpen4-0.1.4...
Installing ri documentation for yui-compressor-0.9.6...
Installing ri documentation for jammit-0.6.5...
Installing RDoc documentation for Platform-0.4.0...
Installing RDoc documentation for open4-1.3.0...
Installing RDoc documentation for POpen4-0.1.4...
Installing RDoc documentation for yui-compressor-0.9.6...
Installing RDoc documentation for jammit-0.6.5...


H:\>config.gem "jammit"
'config.gem' is not recognized as an internal or external command,
operable program or batch file.

H:\>

1 个答案:

答案 0 :(得分:2)

首先,您需要先创建一个Rails应用程序:

  

将gem添加到初始化程序内部的Rails'environment.rb:   config.gem“jammit”

config.gem不是命令rahter,它是environment.rb文件中的条目。

要创建rails应用程序,请转到源文件夹并执行:

rails new <app_name> # replace <app_name> with whatever you want to call your app

它将在一个文件夹中创建一个准确的rails应用程序,其中包含您为该应用程序选择的名称。在该文件夹中,您将找到一个配置文件夹,在该文件夹中,您将看到'environment.rb`