Autotest not working on Windows with rails3 and rspec2?

Hello!

I’m trying to run autotest under Windows when using Rails 3.0.1 and
RSpec 2.0.1. It’s not working so far. This is what happens:
C:\Users\jarmo\Desktop\minu\projects\Ruby\sample_app>autotest
loading autotest/rails_rspec2
style: RailsRspec2
bundle exec C:\bin\pik\Ruby-187-p302\bin\ruby -S C:/bin/pik/Ruby-187-
p302/lib/ruby/gems/1.8/gems/rspec-core-2.0.1/bin/rspec --autotest ‘C:/
Users/jarmo
/Desktop/minu/projects/Ruby/sample_app/spec/controllers/
pages_controller_spec.rb’
bundler: command not found: C:\bin\pik\Ruby-187-p302\bin\ruby
Install missing gem binaries with bundle install

… and then i have to interrupt it manually.

I have installed gems autotest and autotest-rails-pure. Anything else
i have to do to get it running?

Jarmo

No ideas, what might cause that problem? Could it be a Windows-only-
issue?

Jarmo

I didn’t get any replies about that problem so far but i just managed
to find out how to make it work manually.

The problem is that the bundle exec is not working like this on
Windows:
bundle exec C:\bin\pik\Ruby-187-p302\bin\ruby

But works like this:
bundle exec C:\bin\pik\Ruby-187-p302\bin\ruby.exe

I don’t understand who makes that decision what should be executed via
bundler - is it RSpec? Rails? Bundler itself?

Anyway, maybe someone knows what makes up that exec command so i can
open up an issue at correct place.

Jarmo

On Nov 10, 2010, at 7:54 AM, Jarmo P. wrote:

I didn’t get any replies about that problem so far but i just managed
to find out how to make it work manually.

What manual change did you make?

The problem is that the bundle exec is not working like this on
Windows:
bundle exec C:\bin\pik\Ruby-187-p302\bin\ruby

But works like this:
bundle exec C:\bin\pik\Ruby-187-p302\bin\ruby.exe

I don’t understand who makes that decision what should be executed via
bundler - is it RSpec? Rails? Bundler itself?

As of rspec-2.0, rspec prefixes the command with "bundle exec " if there
is a Gemfile, but delegates to Autotest’s definition of the ruby
executable itself.

There is already an issue open in rspec-core to have an opt-out for
"bundle exec ", but that wouldn’t change which ruby executable is used.

Cheers,
David

On Nov 10, 4:06pm, David C. [email protected] wrote:

But works like this:
bundle exec C:\bin\pik\Ruby-187-p302\bin\ruby.exe

Sorry that i didn’t bring it out more - i replaced bin\ruby with bin
\ruby.exe and was able to run that bundle exec from the command line
manually. So if the path to Ruby is constructed by RSpec then it is
bug in RSpec’s otherwise it could be somewhere else. Maybe even in
bundler, which could just add that missing “.exe” by itself… That’s
why i’m asking.

Jarmo

Ok, the path is coming from autotest.rb in autotest gem.

But i think that the bug is in Bundler instead:
C:\Users\jarmo\Desktop\minu\projects\Ruby\sample_app>bundle exec c:
\Ruby\bin\ruby --version
bundler: command not found: c:\Ruby\bin\ruby
Install missing gem binaries with bundle install

C:\Users\jarmo\Desktop\minu\projects\Ruby\sample_app>bundle exec c:
\Ruby\bin\ruby.exe --version
ruby 1.8.6 (2010-02-04 patchlevel 398) [i386-mingw32]

Thank you for the tip, David!

Jarmo

On Nov 10, 2010, at 8:54 AM, Jarmo P. wrote:

bundle exec C:\bin\pik\Ruby-187-p302\bin\ruby

But works like this:
bundle exec C:\bin\pik\Ruby-187-p302\bin\ruby.exe

Sorry that i didn’t bring it out more - i replaced bin\ruby with bin
\ruby.exe and was able to run that bundle exec from the command line
manually. So if the path to Ruby is constructed by RSpec then it is
bug in RSpec’s otherwise it could be somewhere else. Maybe even in
bundler, which could just add that missing “.exe” by itself… That’s
why i’m asking.

RSpec subclasses Autotest
(https://github.com/rspec/rspec-core/blob/master/lib/autotest/rspec2.rb#L5),
generates the command, and delegates the ruby executable to Autotest
(https://github.com/rspec/rspec-core/blob/master/lib/autotest/rspec2.rb#L44).
So it is Autotest that is deciding what ruby command to use.

Cheers,
David

Yup, understood and opened an issue in Bundler since it seems to be
the culprit in the end:
https://github.com/carlhuda/bundler/issues/issue/832

Just FYI if there’s any other Windows/RSpec2/Autotest/Bundler user :slight_smile:

Jarmo

On Nov 10, 2010, at 11:32 AM, Jarmo P. wrote:

Yup, understood and opened an issue in Bundler since it seems to be
the culprit in the end:
https://github.com/carlhuda/bundler/issues/issue/832

Just FYI if there’s any other Windows/RSpec2/Autotest/Bundler user :slight_smile:

Nope. Think you’re the only one :slight_smile:

Thanks for following up on this.

Cheers,
David

On Wed, Nov 10, 2010 at 3:43 PM, David C. [email protected]
wrote:

On Nov 10, 2010, at 11:32 AM, Jarmo P. wrote:

Yup, understood and opened an issue in Bundler since it seems to be
the culprit in the end:
https://github.com/carlhuda/bundler/issues/issue/832

Just FYI if there’s any other Windows/RSpec2/Autotest/Bundler user :slight_smile:

Nope. Think you’re the only one :slight_smile:

If you strip down the Bundler part, I’m under the same environment too
:stuck_out_tongue:

While I can complain about Bundler doing weird things on Windows I
decided to stop using it and switched to Isolate and invoke commands
with “rake isolate:sh[autotest]”

As for autotest coloring issues, for the ones wondering, we
(RubyInstaller) are working on permanent ANSI coloring solutions for
those Windows users.


Luis L.
AREA 17

Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupry

On Nov 10, 9:56pm, Luis L. [email protected] wrote:

If you strip down the Bundler part, I’m under the same environment too :stuck_out_tongue:

While I can complain about Bundler doing weird things on Windows I
decided to stop using it and switched to Isolate and invoke commands
with “rake isolate:sh[autotest]”

I’m still staying with it in hope of it getting better and trying to
give my feedback about it. Hopefully it doesn’t do weird things on
Windows at some point.

As for autotest coloring issues, for the ones wondering, we
(RubyInstaller) are working on permanent ANSI coloring solutions for
those Windows users.

Thanks! I didn’t even bother about writing about that since the
coloring issues are happening quite often here and there. At least
RSpec seems to work nowadays with that correctly.

Can you share some more (even technical) information about these
solutions? Maybe through some other channel if this might get too
offtopic in here…

Jarmo

On Wed, Nov 10, 2010 at 6:29 PM, Jarmo P. [email protected]
wrote:

Can you share some more (even technical) information about these
solutions? Maybe through some other channel if this might get too
offtopic in here…

Search ANSICON and win32console on Rubyinstaller group:

http://groups.google.com/group/rubyinstaller/browse_thread/thread/2d2a62db7281509a/
http://groups.google.com/group/rubyinstaller/browse_thread/thread/be67b409e483db20#

First was the proposal and the first case of problems. The second was
a full investigation and the offer of a bounty to get it fixed.

Any question or problems you have running Ruby on Windows
(RubyInstaller by preference), please don’t hesitate to ask in
RubyInstaller group.


Luis L.
AREA 17

Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupry