Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I have an app build on 1.8.7 and I'm trying to start it on a system with 1.9.3

When I run script/server, I'm getting:

/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?

Thanks Thomas

like image 285
Thomas Avatar asked Mar 06 '12 06:03

Thomas


1 Answers

You don't add the origin path of your test. Add in your script to improve the LOAD_PATH

#!/usr/bin/env ruby
$: << File.dirname(__FILE__) + '../..'
require File.expand_path('../../config/boot', __FILE__)
require 'commands/server
like image 163
shingara Avatar answered Oct 20 '22 00:10

shingara