cannot load such file -- rack (LoadError)

Discussion in 'Ruby/Rails' started by cevo, Jan 4, 2015.

  1. cevo

    cevo Active Member

    I got this error in /usr/local/lsws/logs/stderr.log

    Code:
    2015-01-04 20:04:55.686 [STDERR] /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- rack (LoadError)
    
    from /usr/local/rvm/rubies/ruby-2.1.3/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    
    from /usr/local/lsws/fcgi-bin/RackRunner.rb:13:in `<main>'
    
    gem env
    Code:
    # gem env
    
    RubyGems Environment:
    
      - RUBYGEMS VERSION: 2.4.5
    
      - RUBY VERSION: 2.1.3 (2014-09-19 patchlevel 242) [x86_64-linux]
    
      - INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-2.1.3
    
      - RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-2.1.3/bin/ruby
    
      - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-2.1.3/bin
    
      - SPEC CACHE DIRECTORY: /root/.gem/specs
    
      - SYSTEM CONFIGURATION DIRECTORY: /usr/local/rvm/rubies/ruby-2.1.3/etc
    
      - RUBYGEMS PLATFORMS:
    
        - ruby
    
        - x86_64-linux
    
      - GEM PATHS:
    
        - /usr/local/rvm/gems/ruby-2.1.3
    
        - /usr/local/rvm/gems/ruby-2.1.3@global
    
      - GEM CONFIGURATION:
    
        - :update_sources => true
    
        - :verbose => true
    
        - :backtrace => false
    
        - :bulk_threshold => 1000
    
      - REMOTE SOURCES:
    
        - https://rubygems.org/
    
      - SHELL PATH:
    
        - /usr/local/rvm/gems/ruby-2.1.3/bin
    
        - /usr/local/rvm/gems/ruby-2.1.3@global/bin
    
        - /usr/local/rvm/rubies/ruby-2.1.3/bin
    
        - /usr/local/sbin
    
        - /usr/local/bin
    
        - /usr/sbin
    
        - /usr/bin
    
        - /sbin
    
        - /bin
    
        - /usr/local/rvm/bin
    
    Anyone know how to fix?
     
  2. mistwang

    mistwang LiteSpeed Staff

    How about
    ?
     
  3. cevo

    cevo Active Member

    did that already but problem still exist.
     
  4. cevo

    cevo Active Member

    Would this info given any clue?

    Code:
    root@server:~# find / -name lsws.rb -exec md5sum {} \;
    
    ae20aeee5cc678b12338266a23743cdc  /usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.6.0/lib/rack/handler/lsws.rb
    
    f523b9e558d7fbf29846e35deb97c5ad  /usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/handler/lsws.rb
    
    Or does it possible to have something related to http://www.litespeedtech.com/suppor...-do-something-wrong-with-env.3499/#post-17399
     
  5. cevo

    cevo Active Member

    Code:
    root@server:~# diff  /usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.6.0/lib/rack/handler/lsws.rb /usr/local/rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/handler/lsws.rb
    
    30c30
    
    <         env[QUERY_STRING]   ||= ""
    
    ---
    
    >         env["QUERY_STRING"] ||= ""
    
    
    which one I should use?
     
  6. mistwang

    mistwang LiteSpeed Staff

    uses 1.6.0 code is the better bet. but it may not have any effect on this problem.
    Maybe you should look into the gemset setup if you use rvm.
     
  7. cevo

    cevo Active Member

    This is the detail info from "$rvm info"

    Code:
    root@server:~# rvm info
    
    
    ruby-2.1.3:
    
    
      system:
    
        uname:       "Linux server.citec.us 3.13.0-40-generic #69-Ubuntu SMP Thu Nov 13 17:53:56 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux"
    
        system:      "ubuntu/14.04/x86_64"
    
        bash:        "/bin/bash => GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)"
    
        zsh:         " => not installed"
    
    
      rvm:
    
        version:      "rvm 1.26.7 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
    
        updated:      "4 days 11 hours 36 minutes 22 seconds ago"
    
        path:         "/usr/local/rvm"
    
    
      ruby:
    
        interpreter:  "ruby"
    
        version:      "2.1.3p242"
    
        date:         "2014-09-19"
    
        platform:     "x86_64-linux"
    
        patchlevel:   "2014-09-19 revision 47630"
    
        full_version: "ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-linux]"
    
    
      homes:
    
        gem:          "/usr/local/rvm/gems/ruby-2.1.3"
    
        ruby:         "/usr/local/rvm/rubies/ruby-2.1.3"
    
    
      binaries:
    
        ruby:         "/usr/local/rvm/rubies/ruby-2.1.3/bin/ruby"
    
        irb:          "/usr/local/rvm/rubies/ruby-2.1.3/bin/irb"
    
        gem:          "/usr/local/rvm/rubies/ruby-2.1.3/bin/gem"
    
        rake:         "/usr/local/rvm/gems/ruby-2.1.3/bin/rake"
    
    
      environment:
    
        PATH:         "/usr/local/rvm/gems/ruby-2.1.3/bin:/usr/local/rvm/gems/ruby-2.1.3@global/bin:/usr/local/rvm/rubies/ruby-2.1.3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/rvm/bin"
    
        GEM_HOME:     "/usr/local/rvm/gems/ruby-2.1.3"
    
        GEM_PATH:     "/usr/local/rvm/gems/ruby-2.1.3:/usr/local/rvm/gems/ruby-2.1.3@global"
    
        MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-2.1.3"
    
        IRBRC:        "/usr/local/rvm/rubies/ruby-2.1.3/.irbrc"
    
        RUBYOPT:      ""
    
        gemset:       ""
    
    
     
  8. cevo

    cevo Active Member

    anyone can help? I did the same step with openlitespeed still don't get Ruby on Rail work.
    Anyone got experience to get it work ?
     
  9. mistwang

    mistwang LiteSpeed Staff

  10. cevo

    cevo Active Member

  11. mistwang

    mistwang LiteSpeed Staff

    it may need some GEM related environment variable to work properly, so, just add those to "Environments" under ruby/rails tab.
     
  12. cevo

    cevo Active Member

    Like this? Just tried and restarted LSWS but got same error.
    [​IMG]
     
  13. mistwang

    mistwang LiteSpeed Staff

    use <name>=<value> for environment variable, just like you did from command line, cannot use those values as is.
    GEM_HOME=/usr/local/rvm/gems/ruby-2.1.3
    GEM_PATH=/usr/local/rvm/gems/ruby-2.1.3:/usr/local/rvm/gems/ruby-2.1.3@global
     
  14. cevo

    cevo Active Member

    well, actually I have correct the syntax after posted the reply. Even the same syntax as you suggested is still no luck.
     
  15. mistwang

    mistwang LiteSpeed Staff

    I would suggest not to use RVM, it is big headache, just install ruby and gem from source, then install rails.
     
  16. cevo

    cevo Active Member

    Your idea is like "milk doesn't have a good taste then blame a straw"
    Would it be better if u offer me a debug version or way to debug the part of the code which produced this error message "
    rack (LoadError) or (LoadError)" then we would know what is cause of the problem.
     
  17. mistwang

    mistwang LiteSpeed Staff

    The error is from ruby gem, I think it is that the gem searching path was not set properly.
    You can write a simple rack hello world application, see if you can run it.
    like http://ruby.about.com/od/rack/a/Using-Rack.htm

    RVM is for running multiple version of ruby/rails, if you only use one version, no need to bother.
     
  18. cevo

    cevo Active Member

    Not just simple hello word script I can even run the big website project like this successfully.
    https://github.com/neighborly/neighborly-donate
    https://github.com/catarse/catarse
    But, it was run on rail not litespeed.
     
  19. mbwmbw

    mbwmbw Member

    Any updates on this? We are having same issue.
     

Share This Page