Ruby support in Virtualmin!

6 posts / 0 new
Last post
#1 Thu, 04/30/2009 - 00:10
expro

Ruby support in Virtualmin!

Hi,

Recently I tried to deploy a client's ruby project. Everything was going fine (configuring ruby as CGI for a client in Virtualmin, ruby, gems installtion etc.) till the last step. When I tried to launch the application I got the following error:

[code:1] [Tue Apr 28 18:01:06 2009] [error] [client x.x.x.x] /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/cgi_process.rb:22:in __send__': You have a nil object when you didn't expect it! (NoMethodError) [Tue Apr 28 18:01:06 2009] [error] [client x.x.x.x] The error occurred while evaluating nil.env_table [Tue Apr 28 18:01:06 2009] [error] [client x.x.x.x] \tfrom /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/cgi_process.rb:22:indispatch_cgi' [Tue Apr 28 18:01:06 2009] [error] [client x.x.x.x] \tfrom /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:102:in dispatch_cgi' [Tue Apr 28 18:01:06 2009] [error] [client x.x.x.x] \tfrom /usr/local/lib/ruby/gems/1.8/gems/actionpack-2.3.2/lib/action_controller/dispatcher.rb:28:indispatch' [Tue Apr 28 18:01:06 2009] [error] [client x.x.x.x] \tfrom /srv/www/foo.tld/public_html/public/dispatch.rb:10 [Tue Apr 28 18:01:06 2009] [error] [client x.x.x.x] Premature end of script headers: ruby.cgi [/code:1]

After fast googling I found some information in the web about the problem: [li]http://weblog.rubyonrails.org/ (Removed: CGI Support)[/li] [li]http://github.com/rails/rails/commit/4a3afe0b4f4193d8f35827c5550727f98c6... [li]http://www.ruby-forum.com/topic/182327[/li] [li]https://rails.lighthouseapp.com/projects/8994/tickets/2568-dont-remove-c...

Thought you may be interested in the topic;-) I'm wondering if FastCGI will still work? Of course there are also mod_ruby, mongrel, lighttpd etc. How Virtualmin will support ruby deployments now by default?

Best regards, Filip.<br><br>Post edited by: expro, at: 2009/04/30 00:11

Thu, 04/30/2009 - 03:26
expro

Hi,

I was able to deploy client's application using http://www.modrails.com/documentation/Users%20guide%20Apache.html (installed from gems using virtualmin). I think it could be done also using http://www.modruby.net/. The only thing I'm concerned now, are privilages. I'm expecting all applications/scripts to be executed with appropriate privileges. I'm looking forward to hearing from you about how to do it right withing Virtualmin.

Best regards,
Filip.

Thu, 04/30/2009 - 04:17 (Reply to #2)
expro

And one more source - http://www.modrails.com/documentation/Users%20guide%20Apache.html#user_s...

Now we should worry only about resources consumptions and wait for a Virtualmin to support Phusion Passenger;-)

Thu, 04/30/2009 - 06:53 (Reply to #3)
andreychek

I haven't done much with Ruby on my system, so I can't offer too much info here.

All I can offer is that it sounds like ultimately, Joe and Jamie would like to go with Passenger, but time has been a big constraint here :-)

When using mod_ruby, things will be executed as the Apache user, rather than the Virtual Server owner, which is faster but a bit less secure.

I could have sworn using Mongrel was currently an option, but I'm not seeing it in the UI. Which doesn't necessarily mean it's not there, but it's certainly doing a good job at hiding from me :-)
-Eric

Tue, 05/05/2009 - 14:14 (Reply to #4)
Joe
Joe's picture

<div class='quote'>When using mod_ruby, things will be executed as the Apache user, rather than the Virtual Server owner, which is faster but a bit less secure.</div>

Actually, and thankfully, this isn't true. There apparently is run-as-user support in Passenger (which is why I agreed to support it, and have been working on supporting it).

Mongrel support is already in there, definitely. If you install Ruby on Rails in the Install Scripts interface it will configure a cluster of Mongrels and setup the proxy rules for you. We had a lot of input from the Ruby on Rails experts at Joyent on this aspect of the code. It was pretty universally agreed to be &quot;best practices&quot; at the time when it was released. I've, frankly, never liked the Mongrel way of doing things, but I'm not a Ruby expert, so we weren't going to try to fight it. ;-)

Anyway, Passenger support is definitely coming. But, Ruby on Rails support in Virtualmin Professional is already the best in the industry, to the best of my knowledge...and it should already spin up a nice RoR environment whenever you ask it to.

--

Check out the forum guidelines!

Tue, 05/05/2009 - 00:41 (Reply to #5)
expro

<div class='quote'>All I can offer is that it sounds like ultimately, Joe and Jamie would like to go with Passenger, but time has been a big constraint here :-)</div>

I'm waiting eagerly to see it in next realeses;-)

<div class='quote'>When using mod_ruby, things will be executed as the Apache user, rather than the Virtual Server owner, which is faster but a bit less secure.</div>

The same as in PHP. In shared hosting there is practically no choice on this one.

<div class='quote'>I could have sworn using Mongrel was currently an option, but I'm not seeing it in the UI. Which doesn't necessarily mean it's not there, but it's certainly doing a good job at hiding from me :-)</div>

Unfortunately I haven't seen this option.

Regards,
Filip.

Topic locked