Script / server custom_require.rb: 36: in `require ': cannot load such a file - test / unit / error (LoadError)

I have an application based on 1.8.7 and I am trying to run it on a system with 1.9.3

When I run script / server, I get:

/usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- test/unit/error (LoadError) from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' 

My server script looks like this:

 #!/usr/bin/env ruby require File.expand_path('../../config/boot', __FILE__) require 'commands/server 

What am I missing?

Thank you Thomas

+6
source share
3 answers

You are not adding the original test path. Add to your script to improve LOAD_PATH

 #!/usr/bin/env ruby $: << File.dirname(__FILE__) + '../..' require File.expand_path('../../config/boot', __FILE__) require 'commands/server 
+1
source

In my case, this error occurred because I tried to run the Rails 2.1.1 application with Ruby 2.0.0. I solved this by upgrading to Ruby 1.8.6, which was supported by Rails 2.1.1.

If you want to upgrade your Ruby version, you probably also need to upgrade your Rails application. (Check out this post for Ruby-Rails compatibility information.)

0
source

I decided to remove the ../ path in the file /var/www/redmine-2.6.0/config/boot.rb

 # Before require File.expand_path('../../config/boot', __FILE__) # After require File.expand_path('../config/boot', __FILE__) 

Hope this helps.

Marcos Rogerio

0
source

Source: https://habr.com/ru/post/910053/


All Articles