Mongrel issue when starting Ruby applications using Rails 3.0 [Case 43320]

ghorlacher

Registered
Mar 25, 2010
2
0
51
Spanish Fork Utah
I enabled the Module Installer for Ruby Gems and that installed Rails 3.0. I then go in as a reseller in the cPanel vps optimized gui on port 2082 and click the Ruby on Rails link, setup a rails application and try to start it. It says: "The following Ruby on Rails application was started: appname", then you go back and the status shows it's not started. You can make it run on boot and restart but it won't be running when you check it.

What can I look at to see whats happening when it tries to start?

This was working a few weeks ago I'm pretty sure, but now I cant get it to work on a new cPanel vps. Not sure if it's the newer version of rails or what...
 

mephisto

Member
Feb 1, 2010
19
0
51
Re: Mongrel issue when starting Ruby applications using Rails 3.0

Hello.
I have installed Ruby on Rails using /scripts/installruby on my box (cPanel 11.25.0-C46156 - WHM 11.25.0 - X 3.9, CENTOS 5.5 x86_64 xen hvm on cpanel). There were some problems with sqlite library version, but I managed to overcome them by installing a static version at another location and installing sqlite gem manually.

When going to cPanel I can create new applications and order them to start. My sample application after starting logs something like this:

Code:
** Daemonized, any open files are closed.  Look at log/mongrel.pid and log/mongrel.log for info.
** Starting Mongrel listening at 0.0.0.0:12001
** Starting Rails with production environment...
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require': no such file to load -- dispatcher (LoadError)
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:227:in `load_dependency'
        from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0/lib/active_support/dependencies.rb:239:in `require'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:148:in `rails'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:113:in `cloaker_'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `call'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:in `listener'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:99:in `cloaker_'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `call'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in `initialize'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `new'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in `run'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in `run'
        from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
        from /usr/bin/mongrel_rails:19:in `load'
        from /usr/bin/mongrel_rails:19
Of course it doesn't start and I am unable to use it.

I am using Rails 3.0.0. I found the same problem on Rails 3 RC 3 version here: https://rails.lighthouseapp.com/projects/8994/tickets/4524-mongrel-under-rails-3-beta-3#ticket-4524-8

The topic mentions that I could use a temporary solution to fix the problem. Is it possible to integrate this solution with cPanel somehow? Is anyone else having the same problems? I'm pretty new with Ruby and I am installing it on customers demand.

Help appreciated.

Regards,
mephisto
 

ivanoats

Member
Feb 20, 2006
17
0
151
Seattle, Washington, United States
Downgrade to Rails 2.3.9

You could suggest downgrading to Rails 2.3.9 and I don't think you'll get that activesupport error. I don't think cPanel is compatible with Rails 3.0 yet. Rails 3 is very new and to be honest I don't think it's quite stable yet. Hopefully downgrading is acceptable to your customer.

It would be nice to hear from cPanel when they will support Rails 3.
 

mephisto

Member
Feb 1, 2010
19
0
51
Hey.
Thanks. It actually helped. I don't know why cPanel installs Rails 3.0.0, if it can't use it. Below my way for downgrading (might be useful for others):

Code:
 gem uninstall -v 3.0.0 rails
 gem install rails -v 2.3.9
 gem uninstall -v 3.0.0 actionmailer
 gem uninstall -v 3.0.0 railties
 gem uninstall -v 3.0.0 actionpack
 gem uninstall -v 3.0.0 activerecord
 gem uninstall -v 3.0.0 activemodel
 gem uninstall arel
 gem uninstall -v 3.0.0 activesupport
Before the sample application started I had to recreate it with:

Code:
rails /path/to/new/app/dir
Then I removed it from cPanel and added it again.
 

rhchia

Registered
Sep 14, 2010
3
0
51
hi mephisto, what happened to the code you previously had that is for rails 3.0.0? I in the same situation. i was wondering if i have to 'rebuild' the whole application if i were to downgrade rails 3.0.0 to rails 2.3.9.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Rails 3 is incompatible with Mongrel, the daemon used to serve Rails applications. We are currently examining the issue to resolve the matter.
 

mephisto

Member
Feb 1, 2010
19
0
51
Hi rhchia.
I was installing rails for one of my clients and I don't know rails too much. The sample application had to be rebuild. I removed the old one and created it again with commands:

Code:
 rm path/to/app -r
 mkdir path/to/app
 rails path/to/app
I don't know how to rebuild an existing application. You might try 'rails path/to/app' without deleting the folder (remember to backup first).

Regards,
mephisto
 

rhchia

Registered
Sep 14, 2010
3
0
51
thanks mephisto for the reply.
At first i tot i can 'convert' rails 3 application to use rails 2.3.9 but looking at the file structure i think i i would have to rebuild the application if that's the case. :(
Thanks anyway.
 

rhchia

Registered
Sep 14, 2010
3
0
51
Rails 3 + Ruby 1.8.7 application

Hi guys, currently i have the title mentioned application. Understand that passenger does not support ruby 1.8.6 but since i'm using rails 3, ruby version has to be at least 1.8.7. With mongrel not able to support rails 3 at the moment, any web server to host up my application?
 

ivanoats

Member
Feb 20, 2006
17
0
151
Seattle, Washington, United States
possible fix for rails 3

Rails 3 is incompatible with Mongrel, the daemon used to serve Rails applications. We are currently examining the issue to resolve the matter.
This article may help:
Jan Varwig » Blog Archive » Rails 3 and Mongrel
I haven't tried it yet.

Although, I will put in another plug for passenger compatibility with cPanel, if you could put that on the company's radar, that would be really nice! I'd love to introduce PHP programmers I know to Sinatra, I think they will really like it, as it's a much simpler framework than Rails.

Thanks,
Ivan
 

ghorlacher

Registered
Mar 25, 2010
2
0
51
Spanish Fork Utah
Starts manually

Once I've installed rails packages and made a rails instance, I can run rails 3.0 server and it will startup and work. So looks like Rails is OK, just in cPanel the Manage Ruby on Rails Applications page won't start / stop it. Looks like a bug with cpanel vps optimized.
 

deepthought42

Registered
Oct 4, 2010
1
0
51
when to expect support

I'm experiencing the same problem and as was pointed out cPanel does not yet support rails 3. At this point I am wondering when we can expect support for rails 3?
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Rails 3.0.0 is not compatible with mongrel at this time nor will it properly generate an application in cPanel > Ruby on Rails area due to the major differences in how applications are generated in that version versus Rails 2.3.8 and 2.3.9

For that reason, we've pulled Rails 3.0.0 from being installed as a gem and have set our installer to use Rails 2.3.8 for the time being.

If you decide to go to Rails 3.0.0, you will not be able to use cPanel to generate applications or to start / stop applications, and mongrel will not function with it. You'd have to manually install and manually start up or stop the application.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
There are no current plans yet to support Rails 3+ due to the mongrel issues with that version. Mongrel still has issues working with Rails 2.3.8 actually for properly passing cookies and headers.

I do agree it would be helpful to consider mod_rails with passenger over mongrel, but that's simply my opinion and not any official recommendation from cPanel itself :)
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Since mongrel stable (mongrel | RubyGems.org | your community gem host which is 1.1.5) does not work with Rails 3+, we cannot provide any timeline for when Rails 3+ will be available to use, since we do not control when mongrel will release a version that supports Rails 3+

Unfortunately, so long as we are using mongrel for our environment and so long as mongrel doesn't support Rails 3+, Rails 3+ will not be usable in cPanel. The latest supported version that works with mongrel is Rails 2.3.8 at this time.
 

reallyclicking

Registered
Mar 23, 2011
3
0
51
Since mongrel stable (mongrel | RubyGems.org | your community gem host which is 1.1.5) does not work with Rails 3+, we cannot provide any timeline for when Rails 3+ will be available to use, since we do not control when mongrel will release a version that supports Rails 3+

Unfortunately, so long as we are using mongrel for our environment and so long as mongrel doesn't support Rails 3+, Rails 3+ will not be usable in cPanel. The latest supported version that works with mongrel is Rails 2.3.8 at this time.
It sounds like the next and completely obvious question is - why don't you change the 'environment'? Maybe I'm missing something, I'm NOT a ubergeek when it comes to linux servers, but can't you change that out for something else? nginx? something?

Rails/ruby is RAPIDLY gaining popularity. As you can see from how many people care about being able to host it.

We are going to lose all our hosting business to heroku.