• Home »
  • »
  • LiteSpeed: [STDERR] /usr/lib/ruby/site_ruby/1.8/ rubygems/custom_require.rb:31:in `gem_original_require’: no such file to load — lsapi (MissingSourceFile)

LiteSpeed: [STDERR] /usr/lib/ruby/site_ruby/1.8/ rubygems/custom_require.rb:31:in `gem_original_require’: no such file to load — lsapi (MissingSourceFile)

After restarting LiteSpeed on a server used to develop various Ruby applications there was an error in the LSWS logs. It should be pointed out that the below error was received after straightening out a Ruby installation problem that the server had. The issue was two versions of Ruby were installed with one being installed via source and the other being installed via the Yum Package Manager on this CentOS server. Once the Ruby installation issue was resolved I thought that Rubygems and all of the proper gems had been installed though that was not the case as explained in the below resolution.

LiteSpeed Web Server Eror In stderr.log:


  1. 2010-12-10 18:04:40.318 [STDERR] /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- lsapi (MissingSourceFile)
  2.        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
  3.         from /home/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
  4. 2010-12-10 18:04:40.318 [STDERR]        from /home/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
  5.         from /home/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
  6.        from /var/lsws/fcgi-bin/RailsRunner.rb:29
  7. 2010-12-10 18:04:40.910 [STDERR] /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- lsapi (MissingSourceFile)
  8.         from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
  9.        from /home/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
  10.         from /home/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
  11.        from /home/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
  12.         from /var/lsws/fcgi-bin/RailsRunner.rb:29
  13. 2010-12-10 18:04:41.457 [STDERR] /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- lsapi (MissingSourceFile)
  14.        from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
  15. 2010-12-10 18:04:41.457 [STDERR]        from /home/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
  16.        from /home/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
  17.         from /home/web/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
  18.        from /var/lsws/fcgi-bin/RailsRunner.rb:29

As you can see in the above stderr.log file output LiteSpeed is complaining about a required gem that is not installed called lsapi. LSAPI is LiteSpeed’s open-source API between external applications and the LiteSpeed web server. Resolving this was easy since I am familiar with the necessary gem required to run a Ruby application via LiteSpeed.

Resolve LiteSpeed LSAPI No Such File To Load Error:

To resolve this issue simply install the ruby-lsapi Ruby gem using the “gem install” command as shown below.

Install ruby-lsapi On Linux Server:


  1. [root@dev ~]# gem install ruby-lsapi
  2. Building native extensions.  This could take a while...
  3. Successfully installed ruby-lsapi-4.0
  4. 1 gem installed
  5. Installing ri documentation for ruby-lsapi-4.0...
  6. Installing RDoc documentation for ruby-lsapi-4.0...
  7. [root@dev ~]#

Once the ruby-lsapi gem has been installed I restarted LiteSpeed and the Ruby application, which in this case happened to be Redmine project management software, worked without issue. In this scenario it was a silly mistake forgetting to reinstall ruby-lsapi since it had already been installed however I figured it would be possible to someone not familiar with LiteSpeed/Ruby/Gems to run into this issue and need to be pointed in the right direction by installing the ruby-lsapi gem.

The Ruby Programming Language (Paperback)

List Price: $39.99 USD
New From: $18.00 USD In Stock
Used from: $1.77 USD In Stock

Web Application Architecture: Principles, Protocols and Practices (Paperback)

New From: $32.49 USD In Stock
Used from: $5.76 USD In Stock