创业板安装杂种失败1.9.1(gem install mongrel fails with ruby

2019-07-29 13:09发布

我昨天开始进入自己的轨道发展。
我安装了Ruby 1.9.1,RubyGems的和护栏。
运行gem install mongrel工作得很好,表面上安装杂种太。 我稍微奇怪,因为:

  • 脚本/服务器默认启动的WEBrick
  • which mongrel没有返回值
  • locate mongrel返回很多喜欢的条目
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel
.
.
.
/usr/local/bin/mongrel_rails
/usr/local/lib/ruby/gems/1.9.1/cache/mongrel-1.1.5.gem
/usr/local/lib/ruby/gems/1.9.1/doc/actionpack-2.3.2/rdoc/files/lib/action_controller/vendor/rack-1_0/rack/handler/evented_mongrel_rb.html
/usr/local/lib/ruby/gems/1.9.1/doc/actionpack-2.3.2/rdoc/files/lib/action_controller/vendor/rack-1_0/rack/handler/mongrel_rb.html
/usr/local/lib/ruby/gems/1.9.1/doc/actionpack-2.3.2/rdoc/files/lib/action_controller/vendor/rack-1_0/rack/handler/swiftiplied_mongrel_rb.html
/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/evented_mongrel.rb
/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/mongrel.rb
/usr/local/lib/ruby/gems/1.9.1/gems/actionpack-2.3.2/lib/action_controller/vendor/rack-1.0/rack/handler/swiftiplied_mongrel.rb
/usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5
.
.
.

看起来像我有杂种安装(包括默认安装和我的自定义安装)。 那么,为什么没有哪个杂种返回的东西。

也尝试使用重新安装杂种gem install mongrel回报抛出了自己的一套异常:

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

/usr/local/bin/ruby extconf.rb install mongrel
checking for main() in -lc... yes
creating Makefile

make
gcc -I. -I/usr/local/include/ruby-1.9.1/i386-darwin9.7.0 -I/usr/local/include/ruby-1.9.1/ruby/backward -I/usr/local/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -fno-common -D_XOPEN_SOURCE=1 -O2 -g -Wall -Wno-parentheses  -fno-common -pipe -fno-common  -o http11.o -c http11.c
http11.c: In function 'http_field':
http11.c:77: error: 'struct RString' has no member named 'ptr'
http11.c:77: error: 'struct RString' has no member named 'len'
http11.c:77: warning: left-hand operand of comma expression has no effect
http11.c:77: warning: statement with no effect
http11.c: In function 'header_done':
http11.c:172: error: 'struct RString' has no member named 'ptr'
http11.c:174: error: 'struct RString' has no member named 'ptr'
http11.c:176: error: 'struct RString' has no member named 'ptr'
http11.c:177: error: 'struct RString' has no member named 'len'
http11.c: In function 'HttpParser_execute':
http11.c:298: error: 'struct RString' has no member named 'ptr'
http11.c:299: error: 'struct RString' has no member named 'len'
make: *** [http11.o] Error 1

Answer 1:

它看起来像其他人有运行杂种狗问题上的Ruby 1.9。

由阿美Mahloof的评论好像它可能是一个可能的解决办法:

这里有您需要为了修复它做什么

这里的更新说明:

1)CD /usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/ext/http11

上http11.c和2)须藤VI /配合:

更换线77

为(CH = RSTRING_PTR(f)中,端= CH + RSTRING_LEN(F); CH <端; CH ++){

代替线172与

结肠和strchr =(RSTRING_PTR(TEMP), ':');

更换线174

rb_hash_aset(REQ,global_server_name,rb_str_substr(温度,0,结肠 - RSTRING_PTR(TEMP)));

replce线176,177

rb_str_substr(温度,结肠 - RSTRING_PTR(温度)1,RSTRING_LEN(TEMP)));

更换线路298 299

DPTR = RSTRING_PTR(数据);

DLEN = RSTRING_LEN(数据);

3)保存文件,关闭VI / TextMate的

4)sudo的红宝石extconf.rb && sudo的使须藤&& make install的

5)CD ../../lib/mongrel(或完整路径“/usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/lib/mongrel”

6)配合/须藤VI handlers.rb

7)固定在case语句

上线208-212,改变的情况下“:假”到“再假的”

8)sudo的创业板安装gem_plugin(其他杂种可能会挂起)

完成了!



Answer 2:

您可以安装杂种1.2抢鲜用sudo gem install mongrel --pre

$ sudo gem1.9 install mongrel --pre
> Building native extensions.  This could take a while...
> Successfully installed mongrel-1.2.0.pre2
> 1 gem installed


Answer 3:

这是一个编译问题,所以它更容易做到这一点:

git clone git://github.com/mongrel/mongrel.git

cd mongrel/ext/http/

现在编辑http11.c

#ifndef RSTRING_PTR
#define RSTRING_PTR(s) (RSTRING(s))
#endif
#ifndef RSTRING_LEN
#define RSTRING_LEN(s) (RSTRING(s))
#endif

保存它,现在从同一目录执行以下操作:

sudo ruby extconf.rb && sudo make && sudo make install

完成!



Answer 4:

你可以强制这样安装杂种

sudo的创业板安装杂种-v 1.2.0.pre2 - --with-CFLAGS = \ “ - O2 -march哌本土= -w \”

这解决了问题。



文章来源: gem install mongrel fails with ruby 1.9.1