Rails 3.0 beta & ruby 1.9.1 don't works

Discussion in 'Ruby/Rails' started by Grzegorz Derebecki, Mar 29, 2010.

  1. Grzegorz Derebecki

    Grzegorz Derebecki New Member

    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
  2. mistwang

    mistwang LiteSpeed Staff

    what exactly is proxy_wrappers.rb line 17?

    Maybe required a special function defined in lsreq object?
  3. Grzegorz Derebecki

    Grzegorz Derebecki New Member

    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
  4. Grzegorz Derebecki

    Grzegorz Derebecki New Member

  5. fantasydreaming

    fantasydreaming New Member

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

Share This Page