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)
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
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?
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.
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.
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.
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.
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:
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]
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.