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!
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!
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.
Error starting mongrel on windows after using RubyInstaller 1.9.1 RC2
You need to use Mongrel 1.2.0.pre2 when using Ruby 1.9. If you're upgrading to Ruby 1.9, you should also upgrade to Ruby 1.9.2 since Rails has issues with Ruby 1.9.1.
To install without bundler:
gem install mongrel --pre
In your gemfile:
gem 'mongrel', '1.2.0.pre2'
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.
gssapi requires Ruby version = 1.9.1. on gem install
The package is called 1.9.1 because that is the ABI version.
Ruby uses two parallel versioning schemes: the `Ruby library
compatibility version' (1.9.1 for this package), which is similar to a
library SONAME, and the 'Ruby version' (1.9.3 for this package). Ruby
packages in Debian are named using the Ruby library compatibility
version, which is sometimes confusing for users who do not follow Ruby
development closely. This package depends on the ruby1.9.1 package,
and provides compatibility symbolic links from 1.9.3 executables and
manual pages to their 1.9.1 counterparts.
Ruby on Rails Mongrel error
I'm not able to reproduce (I'm on Ruby 1.9.1 mingw32 right here), but line 52 of cgi_process.rb is calling
if headers.include?('Set-Cookie')
headers['cookie'] = headers.delete('Set-Cookie').split("\n")
end
maybe try checking your session key and cookie settings in environment.rb, and try running ruby script/server webrick (instead of mongrel) to see if that is the issue.
I also know that "about your application" link blows up if you don't have a database created or setup in database.yml, so check that too.
Error loading Mongrel in Aptana Ruby Application on Vista
Seems that the support for Ruby 1.9.1 on windows is still not up to scratch yet due to many libraries that contain native extensions is not built for Ruby 1.9.1.
Try using Ruby 1.8.7 on windows, as it has been around for a long time and stable.
Related Topics
Sunspot_Rails Gem - " Errno:: Econnrefused (Connection Refused - Connect (2)) "
Memory Usage Increase with Ruby 2.1 Versus Ruby 2.0 or 1.9
Map an Array Modifying Only Elements Matching a Certain Condition
Split Array Up into N-Groups of M Size
Does Concurrency Happen Even When Only One Thread Is in a Thread Pool
Connect to Tor Network with Ruby
Referencing Model with String Input
How to Pass a Variable to a Layout
Accessing One Controller Variable in Another Controller in Rails
What Is Purpose of Around_Create Callback in Rails Model
Example of a Prepared Insert Statement Using Ruby Pg Gem