Install Mongrel in Ruby 1.9.3

Install Mongrel in Ruby 1.9.3

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.

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.

gem install mongrel fails with ruby 1.9.1

It looks like other people are having problems running Mongrel on Ruby 1.9.

The comment by Ami Mahloof seems like it might be a possible fix:

Here’s What you need to do in order to fix it

here’s the updated instructions:

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

2) sudo vi / mate on http11.c and:

replace line 77 with

for(ch = RSTRING_PTR(f), end = ch + RSTRING_LEN(f); ch < end; ch++) {

replace line 172 with

colon = strchr(RSTRING_PTR(temp), ':');

replace line 174 with

rb_hash_aset(req, global_server_name, rb_str_substr(temp, 0, colon - RSTRING_PTR(temp)));

replce line 176,177

rb_str_substr(temp, colon - RSTRING_PTR(temp)+1,
RSTRING_LEN(temp)));

replace lines 298 299

dptr = RSTRING_PTR(data);

dlen = RSTRING_LEN(data);

3) save the file, close the vi / textmate

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

5) cd ../../lib/mongrel
(or the full path “/usr/local/lib/ruby/gems/1.9.1/gems/mongrel-1.1.5/lib/mongrel”

6) mate / sudo vi handlers.rb

7) fix the case statements in

On lines 208-212, change instances of “: false” to “then false”

8) sudo gem install gem_plugin (else mongrel may hang)

done!

Errors installing Mongrel 1.2.0_pre2 on Ruby 2.1.x installed via PPA from Brightbox

Okay, so after some hunting around I stumbled across a solution which allows me to cleanly—without a need for manual patching—install Mogrel 1.2.0_pre2 on Ruby 2.1.x. The solution is to do a direct Ruby install of the GEM with --with-cflags like this:

sudo gem install mongrel -v 1.2.0.pre2 -- --with-cflags=\"-O2 -pipe -march=native -w\"

Once I did that compilation was completed without issue and the GEM was successfully installed:

Building native extensions with: '--with-cflags="-O2 -pipe -march=native -w"'
This could take a while...
Successfully installed mongrel-1.2.0.pre2
Parsing documentation for mongrel-1.2.0.pre2
Installing ri documentation for mongrel-1.2.0.pre2
Done installing documentation for mongrel after 1 seconds
1 gem installed

But I am still wondering why a Ruby 2.1.x install via the Brightbox PPA causes an issue when a pure source code install of Ruby 2.1.x has no problems at all.

And not 100% clear on how --with-cflags=\"-O2 -pipe -march=native -w\" factors into this, but it seems to be a common --with-cflags option used to get some stubborn (perhaps outdated?) Ruby GEMs installed on versions of Ruby higher than 1.9.2.

Running Mongrel for Rails with Apache

Checked the Mongrel log files and it appears that the issue was that my database.yml file was specifying the adapter as sqlite3 when it should have been mysql2. I didn't have sqlite3 installed and so Mongrel wouldn't start.

Rails 3.2.14 will not run Mongrel

My memory is that Rails isn't configured to look for mongrel (even if it's installed). You can run mongrel directly though. But you might consider switching to thin. Works just fine and is recognized by Rails automatically.

http://rubygems.org/gems/thin

Building a Ruby stack on Windows Server: msvcrt-ruby18.dll

Seems you're trying to install binary gems for Mongrel on Ruby 1.9.3 when mongrel binaries only work for Ruby 1.8.x

Mongrel hasn't been updated to work with latest Ruby or Rails, so please avoid using it at this time.

You can use Thin as alternative:

gem install eventmachine --pre
gem install thin

The pre-installation of eventmachine pre-release version is required since latest stable 0.12 does not work with Ruby 1.9.x on Windows.

Also, if you're using a version of Windows Server, please ensure Ruby executable (ruby.exe) is added to the DEP exclusion list:

https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting#wiki-dep_segfault



Related Topics



Leave a reply



Submit