I see already initialized constant errors for LIBDIR and BINARY when using spork rc9 and rails 3.0.7.
Preloading Rails environment
/Users/ajsharp/.rvm/gems/ruby-1.9.2-p180@zaarly-api/bundler/gems/spork-897f52a9d2d3/lib/spork.rb:4: warning: already initialized constant BINARY
/Users/ajsharp/.rvm/gems/ruby-1.9.2-p180@zaarly-api/bundler/gems/spork-897f52a9d2d3/lib/spork.rb:5: warning: already initialized constant LIBDIR
Loading Spork.prefork block...
Spork is ready and listening on
Can't reproduce on ruby 0.9.0.rc9 ruby 1.9.2p290, rake 0.9.2.
I see the same thing with:
Changing lib/spork.rb to use defined? fixes it for me:
BINARY = File.expand_path(File.dirname(FILE) + '/../bin/spork') unless defined? BINARY
LIBDIR = Pathname.new(File.expand_path(File.dirname(FILE))) unless defined? LIBDIR
I had the same issue when running spork directly.
Running "bundle exec spork" solved it.
Chipairon's solution solves my problem too and I'm using spork 1.0.0rc4 and ruby 2.0.0p247 (2013-06-27) [x86_64-linux]