LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > External Applications > Ruby/Rails > Will there be official support for Rails >= 2.3

Reply
 
Thread Tools Display Modes
  #1  
Old 01-26-2009, 09:08 AM
tdinkins tdinkins is offline
New Member
 
Join Date: Mar 2007
Posts: 3
Default Will there be official support for Rails >= 2.3

My company is developing some new Rails (2.3) applications and deploying on litespeed.

I know there are currently incompatibilities, but was wondering if the new Rails versions will get the same kind of support that the old versions do.

Being able to configure a rails app in just a few steps is a lot nicer than trying to work out how to get Rack and Litespeed to play nice.
Reply With Quote
  #2  
Old 01-26-2009, 08:55 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,585
add to our to-do list.
Reply With Quote
  #3  
Old 01-26-2009, 09:06 PM
russ816 russ816 is offline
New Member
 
Join Date: Oct 2008
Posts: 5
I work with Tim and these are some of the errors that I've been running into.

This is the config for the external app for the vhost that the context is hooked to:
Code:
Name		rails
Address	uds://tmp/lshttpd/lsruby.sock
Command	/opt/local/bin/ruby /opt/lsws/vhosts/rails/script/lsws.rb
This is the the contents of that file:
Code:
Dir.chdir(File.join(File.dirname(__FILE__), '..'))

require 'rubygems'
require 'lsapi'
require 'rack'

require 'config/environment'

Rack::Handler::LSWS.run(ActionController::Dispatcher.new)
When I request a page from the app I get the following error:
Code:
no such file to load -- /opt/local/lib/ruby/gems/1.8/gems/rack-0.9.1/lib/rack/handler/lsws.rb (MissingSourceFile)
Also, I'm not sure if this is related but I get an error when trying to load up the lsapi gem in irb:
Code:
irb(main):006:0> require 'lsapi'
LS=> true
LSD/opt/local/lib/ruby/1.8/irb/input-method.rb:97:in `readline'LS
: LS1wrong argument type LSAPI (expected File)LS
 (LSTypeErrorLS
)
LSG	from /opt/local/lib/ruby/1.8/irb/input-method.rb:97:in `gets'
LSA	from /opt/local/lib/ruby/1.8/irb.rb:132:in `eval_input'
LSD	from /opt/local/lib/ruby/1.8/irb.rb:263:in `signal_status'
LSA	from /opt/local/lib/ruby/1.8/irb.rb:131:in `eval_input'
LSD	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:189:in `call'
LSI	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:189:in `buf_input'
LSD	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:104:in `getc'
LSD	from /opt/local/lib/ruby/1.8/irb/slex.rb:206:in `match_io'
LS@	from /opt/local/lib/ruby/1.8/irb/slex.rb:76:in `match'
LSE	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:287:in `token'
LSC	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:263:in `lex'
LSX	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:234:in `each_top_level_statement'
LSD	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:230:in `loop'
LSX	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:230:in `each_top_level_statement'
LSE	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:229:in `catch'
LSX	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:229:in `each_top_level_statement'
LSA	from /opt/local/lib/ruby/1.8/irb.rb:146:in `eval_input'
LS;	from /opt/local/lib/ruby/1.8/irb.rb:70:in `start'
LS;	from /opt/local/lib/ruby/1.8/irb.rb:69:in `catch'
LS;	from /opt/local/lib/ruby/1.8/irb.rb:69:in `start'
LS$	from /opt/local/bin/irb:13
I've tried getting Rails 2.3 running with Rack on 3 different machine (CentOS, ArchLinux and Mac OSX), all with the same results.
Reply With Quote
  #4  
Old 01-26-2009, 09:08 PM
russ816 russ816 is offline
New Member
 
Join Date: Oct 2008
Posts: 5
Quote:
Originally Posted by mistwang View Post
add to our to-do list.
Sorry, I was writing my post as you posted yours.
Thanks for the info.
Reply With Quote
  #5  
Old 02-27-2009, 09:16 AM
sniperd sniperd is offline
New Member
 
Join Date: Jun 2008
Posts: 6
Hi Mistwang,

Any update on getting lsws rails 2.3 complaint? I have a bunch of licenses purchased through you guys and plan on maybe even getting more with a large deployment of a new rails app, but if theirs no support on this we cannot use your product.....
Reply With Quote
  #6  
Old 02-27-2009, 08:42 PM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,585
Have taken some time to investigate it tonight, I think a piece of code similar to

rails-2.3.0/lib/commands/server.rb

should work, the main change is to use our Rack handler instead of Mongrel or WEBrick for the server object

server = Rack::Handler::LSWS

Might need some tweaks like our RailsRunner.rb

Due our tight schedule and Ruby programming skills, if any experienced Ruby/Rails developer would to take this project, please contact us. we will pay your time.
Reply With Quote
  #7  
Old 03-01-2009, 06:22 PM
russ816 russ816 is offline
New Member
 
Join Date: Oct 2008
Posts: 5
I'm willing to give it a shot, but I'm running into strange errors when trying to include the Rack:LSWS handler.

When trying to include it from IRB I get:
Code:
irb(main):001:0> require 'rubygems'
=> true
irb(main):002:0> require 'rack'
=> true
irb(main):003:0> require 'rack/handler/lsws'
LS=> true
LSD/opt/local/lib/ruby/1.8/irb/input-method.rb:97:in `readline'LS
: LS1wrong argument type LSAPI (expected File)LS
 (LSTypeErrorLS
)
LSG	from /opt/local/lib/ruby/1.8/irb/input-method.rb:97:in `gets'
LSA	from /opt/local/lib/ruby/1.8/irb.rb:132:in `eval_input'
LSD	from /opt/local/lib/ruby/1.8/irb.rb:263:in `signal_status'
LSA	from /opt/local/lib/ruby/1.8/irb.rb:131:in `eval_input'
LSD	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:189:in `call'
LSI	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:189:in `buf_input'
LSD	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:104:in `getc'
LSD	from /opt/local/lib/ruby/1.8/irb/slex.rb:206:in `match_io'
LS@	from /opt/local/lib/ruby/1.8/irb/slex.rb:76:in `match'
LSE	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:287:in `token'
LSC	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:263:in `lex'
LSX	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:234:in `each_top_level_statement'
LSD	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:230:in `loop'
LSX	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:230:in `each_top_level_statement'
LSE	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:229:in `catch'
LSX	from /opt/local/lib/ruby/1.8/irb/ruby-lex.rb:229:in `each_top_level_statement'
LSA	from /opt/local/lib/ruby/1.8/irb.rb:146:in `eval_input'
LS;	from /opt/local/lib/ruby/1.8/irb.rb:70:in `start'
LS;	from /opt/local/lib/ruby/1.8/irb.rb:69:in `catch'
LS;	from /opt/local/lib/ruby/1.8/irb.rb:69:in `start'
LS$	from /opt/local/bin/irb:13
I just don't understand the error messages it's giving.
Reply With Quote
  #8  
Old 03-01-2009, 08:26 PM
russ816 russ816 is offline
New Member
 
Join Date: Oct 2008
Posts: 5
I think I got it. Just took some time to find the right combination of settings. I've attached the file that needs to be run. It uses the same setup you would use as a normal rack app with lsws. I'll post full details on the setup tomorrow.
Attached Files
File Type: txt lsws.txt (2.3 KB, 6 views)
Reply With Quote
  #9  
Old 03-03-2009, 07:35 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,585
Maybe it need updates on the LSAPI object definition. Make it derive from "File" object could make irb happy.
It is in ruby-lsapi/ext/lsapi/lsruby.c inside Init_lsapi() function.
Reply With Quote
  #10  
Old 03-03-2009, 08:23 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,585
Quote:
Originally Posted by russ816 View Post
I think I got it. Just took some time to find the right combination of settings. I've attached the file that needs to be run. It uses the same setup you would use as a normal rack app with lsws. I'll post full details on the setup tomorrow.
Thanks! It is very close what I thought.
Some code are not necessary, could clear it up a little bit.
Only one concern, our RailsRunner.rb takes care of the DB connection problem caused by fork(), so it close DB connection then reopen it after fork().

The default Rack::Handler::LSWS does not have this logic, so it may not work properly.

I am thinking about a dedicate Rack handler for Rails, maybe call it Rack::Handler::LSRAILS, it should be similar to Rack::Handler::LSWS, just add logic like the what we have in RailsRunner.rb . All the code could be in one file.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 01:42 PM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.