LiteSpeed Support Forums

LiteSpeed Support Forums (http://www.litespeedtech.com/support/forum/index.php)
-   Ruby/Rails (http://www.litespeedtech.com/support/forum/forumdisplay.php?f=20)
-   -   Rails 3.0 beta & ruby 1.9.1 don't works (http://www.litespeedtech.com/support/forum/showthread.php?t=3920)

Grzegorz Derebecki 03-29-2010 02:50 AM

Rails 3.0 beta & ruby 1.9.1 don't works
 
Currently lsapi can't run rails 3 beta i fixed some issuses but still get errors.

Here is my railsrunner (only for test with hardcoded paths):

Code:


#!/usr/bin/env ruby

ENV['RAILS_ROOT'] = "/Users/madmax/Sites/rails3-test"
Dir.chdir(ENV['RAILS_ROOT'])

#require 'lsapi'
require 'config/boot'
require 'active_support'
require 'action_controller'
require 'fileutils'
 
options = {
  :environment => (ENV['RAILS_ENV'] || "development").dup,
  :config => "/Users/madmax/Sites/rails3-test/config.ru",
  :detach => false,
  :debugger => false
}
 
server = Rack::Handler::LSWS
 
if File.exist?(options[:config])
  config = options[:config]
  if config =~ /\.ru$/
    cfgfile = File.read(config)
    if cfgfile[/^#\\(.*)/]
      opts.parse!($1.split(/\s+/))
    end
    inner_app = eval("Rack::Builder.new {( " + cfgfile + "\n )}.to_app", nil, config)
  else
    require config
    inner_app = Object.const_get(File.basename(config, '.rb').capitalize)
  end
else
  require 'config/environment'
  inner_app = ActionController::Dispatcher.new
end
 
app = Rack::Builder.new {
  use Rails::Rack::Static
  use Rails::Rack::Debugger if options[:debugger]
  run inner_app
}.to_app
 
ActiveRecord::Base.clear_active_connections! if defined?(ActiveRecord::Base)
 
begin
  server.run(app, options.merge(:AccessLog => []))
ensure
  puts 'Exiting'
end

Here is returned error

Code:

/opt/lsws/fcgi-bin% ./rails3.rb           
LSl/Users/madmax/Sites/rails/activesupport/lib/active_support/deprecation/proxy_wrappers.rb:17:in `new'LS
: LS+wrong number of arguments (1 for 2)LS
 (LSArgumentErrorLS
)
LS~        from /Users/madmax/Sites/rails/activesupport/lib/active_support/deprecation/proxy_wrappers.rb:17:in `method_missing'
LSo        from /Users/madmax/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/builder.rb:54:in `block in use'
LSg        from /Users/madmax/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/builder.rb:73:in `call'
LSr        from /Users/madmax/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/builder.rb:73:in `block in to_app'
LSg        from /Users/madmax/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/builder.rb:73:in `each'
LSi        from /Users/madmax/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/builder.rb:73:in `inject'
LSi        from /Users/madmax/.rvm/gems/ruby-1.9.1-p378/gems/rack-1.1.0/lib/rack/builder.rb:73:in `to_app'
LS)        from ./rails3.rb:38:in `<main>'


To install and check rails3 with ruby 1.9.1 i recommend to use rvm
here is 8 minuts screencats how easy it is


http://railscasts.com/episodes/200-rails-3-beta-and-rvm

mistwang 04-02-2010 10:48 AM

what exactly is proxy_wrappers.rb line 17?

Maybe required a special function defined in lsreq object?

Grzegorz Derebecki 04-02-2010 02:05 PM

Quote:

Originally Posted by mistwang (Post 19285)
what exactly is proxy_wrappers.rb line 17?

Maybe required a special function defined in lsreq object?

it is in deprecation folder that meen it probably will be removed in next version :) Don't know try install ruby 1.9.1 (with rvm is so easy) and rails 3 beta

http://railscasts.com/episodes/200-rails-3-beta-and-rvm

Grzegorz Derebecki 05-17-2010 11:40 AM

I wrote my own rails3 runner:

http://www.litespeedtech.com/support...ead.php?t=4025

fantasydreaming 01-28-2011 06:43 PM

This still hasn't been integrated into the official lsapi yet it seems?? :(


All times are GMT -7. The time now is 09:40 PM.