在Ruby 1.9.3中安装Mongrel

时间:2022-08-25 20:43:27

How can I successfully install Mongrel for ruby 1.9.3

如何成功地为ruby 1.9.3安装Mongrel

Here's the error:

这是一个错误:

Building native extensions.  This could take a while...
ERROR:  Error installing mongrel:
    ERROR: Failed to build gem native extension.

        /usr/bin/ruby1.9.1 extconf.rb
checking for main() in -lc... yes
creating Makefile

make
compiling http11_parser.c
compiling http11.c
http11.c: In function ‘http_field’:
http11.c:70:3: error: format not a string literal and no format arguments [-Werror=format-security]
http11.c:71:3: error: format not a string literal and no format arguments [-Werror=format-security]
http11.c:77:22: error: ‘struct RString’ has no member named ‘ptr’
http11.c:77:50: error: ‘struct RString’ has no member named ‘len’
http11.c:77:27: warning: left-hand operand of comma expression has no effect [-Wunused-value]
http11.c: In function ‘request_uri’:
http11.c:102:3: error: format not a string literal and no format arguments [-Werror=format-security]
http11.c: In function ‘fragment’:
http11.c:113:3: error: format not a string literal and no format arguments [-Werror=format-security]
http11.c: In function ‘request_path’:
http11.c:124:3: error: format not a string literal and no format arguments [-Werror=format-security]
http11.c: In function ‘query_string’:
http11.c:135:3: error: format not a string literal and no format arguments [-Werror=format-security]
http11.c: In function ‘header_done’:
http11.c:172:13: error: ‘struct RString’ has no member named ‘ptr’
http11.c:172:13: error: ‘struct RString’ has no member named ‘ptr’
http11.c:172:13: error: ‘struct RString’ has no member named ‘ptr’
http11.c:174:89: error: ‘struct RString’ has no member named ‘ptr’
http11.c:176:52: error: ‘struct RString’ has no member named ‘ptr’
http11.c:177:26: error: ‘struct RString’ has no member named ‘len’
http11.c: In function ‘HttpParser_execute’:
http11.c:298:23: error: ‘struct RString’ has no member named ‘ptr’
http11.c:299:23: error: ‘struct RString’ has no member named ‘len’
http11.c:307:5: error: format not a string literal and no format arguments [-Werror=format-security]
cc1: some warnings being treated as errors
make: *** [http11.o] Error 1


Gem files will remain installed in /var/lib/gems/1.9.1/gems/mongrel-1.1.5 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/mongrel-1.1.5/ext/http11/gem_make.out

I already tried sudo gem install mongrel --pre and even the one that has --source

我已经试过sudo gem安装mongrel——pre,甚至还有那个有源代码的

I don't know why it isn't working. Is it compatible with Ruby 1.9.1 and up?

我不知道为什么它不起作用。它与Ruby 1.9.1和up兼容吗?

3 个解决方案

#1


10  

You are not alone. In the thread, however, there’s a link to a possible fix. I’ve not tried it so YMMV, but it seems like a plausible fix.

你并不孤单。然而,在线程中有一个可能修复的链接。我还没试过YMMV,但这似乎是一个合理的解决办法。

Given that Mongrel is no longer being updated, though, why not switch to something like Thin?

既然杂种狗不再被更新,为什么不改用瘦的呢?

Edit: Sorry, I see that you're asking about 1.9.3. My understanding is that Mongrel is (supposed to be) compatible with up to 1.9.1, but broken in 1.9.2+. Yet another good reason to switch to something more modern and maintained.

编辑:对不起,我看到你问的是1。9.3。我的理解是,Mongrel(应该是)与1.9.1兼容,但在1.9.2+中被破坏。另一个很好的理由是转向更现代和更持久的东西。

#2


9  

below command,

下面的命令,

gem install mongrel --pre

works well.

工作得很好。

ref: check this link for more details

ref:查看这个链接了解更多细节

#3


1  

As John B stated, switch to Thin.

正如约翰·B所说,变瘦。

After not being able to get Mongrel to install with my current set up with Ruby 1.9.3, I commented out Mongrel from my Gemfile and added Thin. This let my app fully install and run great.

在无法让Mongrel安装与Ruby 1.9.3的当前设置之后,我将Mongrel从Gemfile中删除,并添加了Thin。这让我的应用程序完全安装和运行良好。

In my Gemfile

在我Gemfile

#gem 'mongrel', '1.2.0.pre2'
gem 'thin'

then run

然后运行

bundle install

#1


10  

You are not alone. In the thread, however, there’s a link to a possible fix. I’ve not tried it so YMMV, but it seems like a plausible fix.

你并不孤单。然而,在线程中有一个可能修复的链接。我还没试过YMMV,但这似乎是一个合理的解决办法。

Given that Mongrel is no longer being updated, though, why not switch to something like Thin?

既然杂种狗不再被更新,为什么不改用瘦的呢?

Edit: Sorry, I see that you're asking about 1.9.3. My understanding is that Mongrel is (supposed to be) compatible with up to 1.9.1, but broken in 1.9.2+. Yet another good reason to switch to something more modern and maintained.

编辑:对不起,我看到你问的是1。9.3。我的理解是,Mongrel(应该是)与1.9.1兼容,但在1.9.2+中被破坏。另一个很好的理由是转向更现代和更持久的东西。

#2


9  

below command,

下面的命令,

gem install mongrel --pre

works well.

工作得很好。

ref: check this link for more details

ref:查看这个链接了解更多细节

#3


1  

As John B stated, switch to Thin.

正如约翰·B所说,变瘦。

After not being able to get Mongrel to install with my current set up with Ruby 1.9.3, I commented out Mongrel from my Gemfile and added Thin. This let my app fully install and run great.

在无法让Mongrel安装与Ruby 1.9.3的当前设置之后,我将Mongrel从Gemfile中删除,并添加了Thin。这让我的应用程序完全安装和运行良好。

In my Gemfile

在我Gemfile

#gem 'mongrel', '1.2.0.pre2'
gem 'thin'

then run

然后运行

bundle install