Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gem install mongrel fails with ruby 1.9.1

Tags:

I initiated myself into rails development yesterday.
I installed ruby 1.9.1, rubygems and rails.
Running gem install mongrel worked fine and ostensibly installed mongrel too. I am slightly puzzled because:

  • script/server starts webrick by default
  • which mongrel returns nothing
  • locate mongrel returns lots of entries like
 /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 . . . 

Does look like I have mongrel installed (both the default installation and my custom install). So why doesn't which mongrel return something.

Also trying to reinstall mongrel using gem install mongrel returns throws its own set of exceptions:

 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 
like image 503
atlantis Avatar asked Jul 02 '09 11:07

atlantis


People also ask

Is Gem installed with Ruby?

The Gem command is included with Ruby 1.9+ now, and is a standard addition to Ruby pre-1.9.

How do I install a new gem?

To install a gem, use gem install [gem] . Browsing installed gems is done with gem list . For more information about the gem command, see below or head to RubyGems' docs. There are other sources of libraries though.

How do gems work in Ruby?

Gems can be used to extend or modify functionality in Ruby applications. Commonly they're used to distribute reusable functionality that is shared with other Rubyists for use in their applications and libraries. Some gems provide command line utilities to help automate tasks and speed up your work.

What is gem native extension?

“Native extensions” are the glue that connects a Ruby gem with some other non-Ruby software component or library present on your machine.


1 Answers

You can install mongrel 1.2 prerelease with 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 
like image 178
kch Avatar answered Sep 23 '22 23:09

kch