[rspec-users] Ruby 1.9 - autospec loadpath problem

Mikel Lindsaar raasdnil at gmail.com
Sun Nov 30 17:24:41 EST 2008


Mac OSX 10.5.5(Ruby 1.8.6 installed already)

I installed Ruby 1.9.1 preview thusly:

==============================================
port install readline
cd ruby-1.9.1-preview1
./configure --program-suffix=-trunk --with-readline-dir=/usr/local
make
make install
==============================================

Then move my environment over to the trunk version:

==============================================
ln -s /usr/local/bin/ruby-trunk /usr/bin/ruby
ln -s /usr/local/bin/rake-trunk /usr/bin/rake
ln -s /usr/local/bin/gem-trunk /usr/bin/gem
==============================================

Then the first thing to do of course:

==============================================
gem install rspec
gem install ZenTest
==============================================

all good so far

Then change into my new mail project (rewriting all the good bits of tmail
into a 1.9 based, encoding savvy, oniguma laced, mail hooligan) and do the
deed:

==============================================
cd ~/ruby_programs/mail
autospec
==============================================

Gets me:

==============================================
mikel at baci.local ~/ruby_programs/mail
 $ autospec
/usr/local/bin/autotest:19:in `load': Is a directory -
/usr/local/lib/ruby-trunk/gems/1.9.1/gems/rspec-1.1.11/lib/autotest
(Errno::EISDIR)
from /usr/local/bin/autotest:19:in `<main>'
==============================================

Opening up /usr/local/bin/autotest shows me that line 19 says:

load 'autotest'

Thinks... "Ah... load path problem".  so I puts a puts to see what puts:

==============================================
puts $LOAD_PATH
load 'autotest'
==============================================

And I gets:

==============================================
 mikel at baci.local ~/ruby_programs/mail
  $ autospec
 /usr/local/lib/ruby-trunk/gems/1.9.1/gems/columnize-0.2/lib
 /usr/local/lib/ruby-trunk/gems/1.9.1/gems/linecache-0.43/lib
 /usr/local/lib/ruby-trunk/gems/1.9.1/gems/rspec-1.1.11/bin
 /usr/local/lib/ruby-trunk/gems/1.9.1/gems/rspec-1.1.11/lib
 /usr/local/lib/ruby-trunk/gems/1.9.1/gems/ZenTest-3.11.0/bin
 /usr/local/lib/ruby-trunk/gems/1.9.1/gems/ZenTest-3.11.0/lib
 /usr/local/lib/ruby-trunk/site_ruby/1.9.1
 /usr/local/lib/ruby-trunk/site_ruby/1.9.1/i386-darwin9.5.0
 /usr/local/lib/ruby-trunk/site_ruby
 /usr/local/lib/ruby-trunk/vendor_ruby/1.9.1
 /usr/local/lib/ruby-trunk/vendor_ruby/1.9.1/i386-darwin9.5.0
 /usr/local/lib/ruby-trunk/vendor_ruby
 /usr/local/lib/ruby-trunk/1.9.1
 /usr/local/lib/ruby-trunk/1.9.1/i386-darwin9.5.0
 .
 loading autotest/rspec
 /usr/local/lib/ruby-trunk/gems/1.9.1/gems/ZenTest-3.11.0/bin/autotest:49:in
`require':
/usr/local/lib/ruby-trunk/gems/1.9.1/gems/rspec-1.1.11/lib/autotest/rspec.rb:31:
 target of repeat operator is invalid: /\n(\.\/)?(.*spec\.rb):[\d]+:\Z?/
(SyntaxError)
from
/usr/local/lib/ruby-trunk/gems/1.9.1/gems/ZenTest-3.11.0/bin/autotest:49:in
`<top (required)>'
from /usr/local/bin/autotest:20:in `load'
from /usr/local/bin/autotest:20:in `<main>'
==============================================

Looking in /usr/local/lib/ruby-trunk/gems/1.9.1/gems/rspec-1.1.11/lib gives:

==============================================
mikel at baci.local ~/ruby_programs/mail
 $ ls -al /usr/local/lib/ruby-trunk/gems/1.9.1/gems/rspec-1.1.11/lib
total 8
drwxr-xr-x   5 root  wheel  170  1 Dec 09:05 .
drwxr-xr-x  19 root  wheel  646  1 Dec 09:05 ..
drwxr-xr-x   4 root  wheel  136  1 Dec 09:05 autotest
drwxr-xr-x  21 root  wheel  714  1 Dec 09:05 spec
-rw-r--r--   1 root  wheel  561  1 Dec 09:05 spec.rb
==============================================

So load is trying to load autotest the directory instead of autotest the
script.

Any ideas on how to get it to load the right thing?

-- 
http://lindsaar.net/
Rails, RSpec and Life blog....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20081201/6c6d2dad/attachment.html>


More information about the rspec-users mailing list