Can't install mongrel

Hi guys!

I’m a Rails Developer and I’m beginning with JRuby on Rails. I’m reading
(and enjoying) 0la Bini’s new book, and when I tryed to install
mongrel’s
gem, i get this error:

Error opening script file: extconf.rb (No such file or directory)
ERROR: While executing gem … (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.

ruby extconf.rb install -y mongrel

Gem files will remain installed in
/usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0
/ext/fastthread/gem_make.out

One big thing, in his book Ola says we suppose to find a gem compiled
for
java or jruby, but when I run the command I get this:

Select which gem to install for your platform (java)

  1. mongrel 1.0.1 (mswin32)
  2. mongrel 1.0.1 (ruby)
  3. mongrel 1.0 (ruby)
  4. mongrel 1.0 (mswin32)
  5. mongrel 0.3.13.4 (ruby)
  6. mongrel 0.3.13.3 (mswin32)
  7. mongrel 0.3.13.3 (ruby)
  8. Skip this gem
  9. Cancel installation

What could be wrong?

Juan Maria Martinez A. wrote:

ruby extconf.rb install -y mongrel

Gem files will remain installed in
/usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0 for inspection.
Results logged to
/usr/local/lib/ruby/gems/1.8/gems/fastthread-1.0/ext/fastthread/gem_make.out

One big thing, in his book Ola says we suppose to find a gem compiled
for java or jruby, but when I run the command I get this:
Hi Juan,

Yeah, I’m sorry about that - we were supposed to have released an
official Mongrel-JRuby gem by now, but that hasn’t been done yet. What
you need to do is to download the gem from
http://rubyforge.org/frs/download.php/20097/mongrel-1.0.1-jruby.gem, and
install manually by doing
jruby -S gem install mongrel-1.0.1-jruby.gem

Hope that helps.

Cheers


Ola B. (http://ola-bini.blogspot.com)
JRuby Core Developer
Developer, ThoughtWorks Studios (http://studios.thoughtworks.com)
Practical JRuby on Rails (http://apress.com/book/view/9781590598818)

“Yields falsehood when quined” yields falsehood when quined.


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Ola B. said…

for java or jruby, but when I run the command I get this:
Hi Juan,

Yeah, I’m sorry about that - we were supposed to have released an
official Mongrel-JRuby gem by now, but that hasn’t been done yet. What
you need to do is to download the gem from
http://rubyforge.org/frs/download.php/20097/mongrel-1.0.1-jruby.gem, and
install manually by doing
jruby -S gem install mongrel-1.0.1-jruby.gem

Hope that helps.

Does this gem provide mongrel rails cluster?

And, regardless, can it be used as a proxy via apache?


Cheers,
Marc


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Thanks Ola! I downloaded the gem and installed it locally and that
worked
just fine!

Now, this won’t install the mongrel cluster, to do that you have to run:

jruby -S gem install mongrel_jcluster.

On 9/30/07, marc [email protected] wrote:

Ola B. said…

jruby -S gem install mongrel-1.0.1-jruby.gem
Does this gem provide mongrel rails cluster?

No. In MRI land you must be referring to mongrel_cluster gem. It’s
merely a relatively convenient way to run a bunch of Mongrel processes
bound to a continuous range of ports. You don’t really need it.

And, regardless, can it be used as a proxy via apache?
Of course, mongrel-jruby is still a web server. It has virtually same
functionality as the original, but running under JVM, and the native
stuff (HTTP parsing) in it is compiled to Java classes.


Alexey V.
CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com]
RubyWorks [http://rubyworks.thoughtworks.com]


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Alexey V. said…

On 9/30/07, marc [email protected] wrote:

Ola B. said…

jruby -S gem install mongrel-1.0.1-jruby.gem
Does this gem provide mongrel rails cluster?

No. In MRI land you must be referring to mongrel_cluster gem. It’s
merely a relatively convenient way to run a bunch of Mongrel processes
bound to a continuous range of ports. You don’t really need it.

Indeed.

And, regardless, can it be used as a proxy via apache?
Of course, mongrel-jruby is still a web server. It has virtually same
functionality as the original, but running under JVM, and the native
stuff (HTTP parsing) in it is compiled to Java classes.

Excellent. Thanks. I’ll give it a spin.


Cheers,
Marc


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email
      mongrel requires gem_plugin >= 0.2.2
  A plugin system based only on rubygems that uses dependencies only

mongrel is already successfully installed and running, but I presume
something extra is required for jruby.


try:
jruby gem list
if it doesn’t mention gem_plugin then do
jruby gem install gem_plugin

ruby and jruby keep their gems in different locations by default.


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

marc said…

Indeed.

And, regardless, can it be used as a proxy via apache?
Of course, mongrel-jruby is still a web server. It has virtually same
functionality as the original, but running under JVM, and the native
stuff (HTTP parsing) in it is compiled to Java classes.

Excellent. Thanks. I’ll give it a spin.

No joy, I’m afraid.

jruby -S gem install mongrel-1.0.1-jruby.gem

results in

ERROR: While executing gem … (RuntimeError)
Error instaling mongrel-1.0.1-jruby.gem:
mongrel requires gem_plugin >= 0.2.2

while

gem list gem*

reports

*** LOCAL GEMS ***

gem_plugin (0.2.2)
A plugin system based only on rubygems that uses dependencies only

mongrel is already successfully installed and running, but I presume
something extra is required for jruby.


Cheers,
Marc


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

Dimitri Krassovski said…

      mongrel requires gem_plugin >= 0.2.2
  A plugin system based only on rubygems that uses dependencies only

ruby and jruby keep their gems in different locations by default.
Ah! I see.

After a bit of footling around, I realised that I needed to start
running things from $JRUBY_HOME/bin, since while jruby was being found
okay in other locations, gem was probably being run from /usr/bin. For
example
jruby gen list
simply errored.

Anyway, I seem to be there with the installs. I’ll get to trying to run
mongrel-jruby under apache tomorrow.

Thanks for all the help folks.


Cheers,
Marc


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

mongrel is already successfully installed and running, but I presume
something extra is required for jruby.

Sorry my last reply, I made a typo.
It’s “jruby -S gem list” and “jruby -S gem install”


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

I’ve installed the same mongrel gem and when i try run the rails
application
i get the very same error.

when i run jruby script/server webbrick it work just fine, I guess
something’s missing, but I can’t visualize it. What could it be?

Alexey V. said…

Of course, mongrel-jruby is still a web server. It has virtually same
functionality as the original, but running under JVM, and the native
stuff (HTTP parsing) in it is compiled to Java classes.

Having installed mongrel-jruby, and created a rails project, when I try
to start rails I get the following (though, jruby script/server webrick
works okay):

marc@mote:~/testapp$ jruby script/server -p 4040
=> Booting Mongrel (use ‘script/server webrick’ to force WEBrick)
=> Rails application starting on http://0.0.0.0:4040
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Ruby version is not up-to-date; loading cgi_multipart_eof_fix
** Starting Mongrel listening at 0.0.0.0:4040
** Starting Rails with development environment…
** Rails loaded.
** Loading any Rails specific GemPlugins
Exiting
Signal.java:149:in sun.misc.Signal.handle': java.lang.IllegalArgumentException: Signal already used by VM: SIGUSR1 (NativeException) from NativeMethodAccessorImpl.java:-2:in sun.reflect.NativeMethodAccessorImpl.invoke0’
from NativeMethodAccessorImpl.java:39:in
sun.reflect.NativeMethodAccessorImpl.invoke' from DelegatingMethodAccessorImpl.java:25:in sun.reflect.DelegatingMethodAccessorImpl.invoke’
from Method.java:597:in java.lang.reflect.Method.invoke' from JavaMethod.java:196:in org.jruby.javasupport.JavaMethod.invokeWithExceptionHandling’
from JavaMethod.java:182:in
org.jruby.javasupport.JavaMethod.invoke_static' from JavaClass.java:371:in org.jruby.javasupport.JavaClass
$StaticMethodInvoker.execute’
from SimpleCallbackMethod.java:81:in
org.jruby.internal.runtime.methods.SimpleCallbackMethod.call' ... 230 levels... from /home/marc/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in require’
from
/home/marc/jruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require’
from :1
Complete Java stackTrace

It is definitely mongrel-jruby that I have installed:

marc@mote:~/jruby/bin$ jruby -S gem uninstall mongrel

You have requested to uninstall the gem:
mongrel-1.0.1-jruby
mongrel_jcluster-0.0.1 depends on [mongrel (>= 0.3.13.4)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn]


Cheers,
Marc


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email

On 10/1/07, Juan Maria Martinez A. [email protected] wrote:

java.lang.IllegalArgumentException: Signal already used
by VM: SIGUSR1

… is a JIRA ticket: http://jira.codehaus.org/browse/JRUBY-1277

JVM already has a custom signal handler for USR1, and does not allow
applications to override it.

The workaround is to modify the Mongrel code so that it doesn’t try to
register signal handlers. This means that Mongrel will not be able to
hot-reload Rails app it is running, but nobody uses that facility
anyway, so it’s ok.

By the way, if anyone knows how to fix this, pray tell.


Alexey V.
CruiseControl.rb [http://cruisecontrolrb.thoughtworks.com]
RubyWorks [http://rubyworks.thoughtworks.com]


To unsubscribe from this list please visit:

http://xircles.codehaus.org/manage_email