3

我正在尝试在我的 Mac 上安装以下 ruby​​ gem:

http://www.sinatrarb.com/intro.html

我收到以下消息:

    michael-rosarios-macbook:bin michaelrosario1$ mono ir.exe igem sinatra
    ERROR:  While executing gem ... (RuntimeError)
        Unknown command sinatra
    michael-rosarios-macbook:bin michaelrosario1$ 

更熟悉 Ruby/IronRuby 的人可以帮助我吗?

4

2 回答 2

1

看来我错过了安装 sinatra 的争论:

michael-rosarios-macbook:bin michaelrosario1$ mono ir.exe igem install sinatra
Successfully installed rack-1.0.0
Successfully installed sinatra-0.9.4
2 gems installed
Installing ri documentation for rack-1.0.0...
Installing ri documentation for sinatra-0.9.4...
Installing RDoc documentation for rack-1.0.0...
Installing RDoc documentation for sinatra-0.9.4...

我现在在使用 Sinatra 编写“hello world”示例时遇到问题。这可能与Shay的评论有关。还有什么想法!?

于 2009-08-02T11:18:39.163 回答
0

第一件事 - 我不熟悉单声道,但在 Windows 上,我会在没有 ir 的情况下执行“igem sinatra”。也许这就是问题所在?

无论如何,如果您在使用 igem 安装 gem 时遇到问题,请尝试使用 MRI gem 安装程序。之后,您将能够通过 IronRuby 使用它,只需稍加调整即可。

在您的 ruby​​ 文件中添加下一行: $LOAD_PATH << path_to_mri_gems_folder 其中 path_to_mri_gems_folder 将是 MRI gems 文件夹的完整路径。在这条线之后需要sinatra。

还有一个用于 Sinatra 的 IronRuby 团队的补丁,我不确定它是否仍然需要: http ://www.ironruby.net/Documentation/Real_Ruby_Applications/Sinatra

谢伊。

于 2009-08-02T05:09:56.957 回答