jonleighton / spring-commands-rspec

MIT License
378 stars 37 forks source link

binstub doesn't seem to be working #17

Closed cjbottaro closed 9 years ago

cjbottaro commented 10 years ago

I installed spring-commands-rspec, stopped Spring, issued a spring binstub rspec, it created it with this content:

#!/usr/bin/env ruby
begin
  load File.expand_path("../spring", __FILE__)
rescue LoadError
end
require 'bundler/setup'
load Gem.bin_path('rspec-core', 'rspec')

But now each time I run rspec spec it doesn't start Spring. Not using the binstub works fine (spring rspec spec).

asiniy commented 10 years ago

@cjbottaro I have the same problem. Do you use an rvm?

diasjorge commented 10 years ago

I also have the same problem. I use rvm

asiniy commented 10 years ago

Guys, it seems that it isn't binstub problem. It much like rvm trouble. Just try to bin/rspec or add raise code to binstubbed file and try to run usual rspec spec & bin/rspec spec

cjbottaro commented 10 years ago

@asiniy No, I use rbenv.

asiniy commented 10 years ago

@cjbottaro maybe it is both rbenv & rvm trouble?

Anyway, answer by maintainers will be great.

asiniy commented 10 years ago

related issue at stack overflow

Olefine commented 10 years ago

is problem still present?

itsNikolay commented 10 years ago

Not working for me (Rbenv) I run $ bin/rspec bin/rspec has the same content from the first comment.

Commands for your application:

 . . .
  rails           Run a rails command. The following sub commands will use spring: console, runner, generate, destroy.
  rake            Runs the rake command
  rspec           Runs the rspec command
/home/itsnikolay/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `load': cannot load such file -- /home/itsnikolay/projects/CUSTOMERS/resretailr/rspec (LoadError)
        from /home/itsnikolay/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `block in load_spec_files'
        from /home/itsnikolay/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `each'
        from /home/itsnikolay/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.3/lib/rspec/core/configuration.rb:1057:in `load_spec_files'
driv3r commented 10 years ago

same error as @itsNikolay here, with clean rails app and RVM, maybe it's related to rspec 3?

erickbrower commented 10 years ago

Experiencing the same error ^ on chruby

izidorome commented 10 years ago

Same problem here: Rspec 3 Rails 4.1

tf commented 10 years ago

Same problem: RSpec 3.1 Rails 4.2.0.beta1

tf commented 10 years ago

Workes after running spring stop. Seems like the rspec command had not been registered yet.

Imomoi commented 10 years ago

@itsNikolay this answer helped me http://stackoverflow.com/a/21260385

Just remove gem 'spring', group: :development from the Gemfile so that you only have gem 'spring-commands-rspec' left.

itsNikolay commented 10 years ago

@Imomoi I think that spring stop (as described above) is enough. Because now the gem works fine in my apps. Thanks for reply.

jtomaszewski commented 9 years ago

Yeah, spring stop helps that completely. That's how it end when you don't read the README.md ;]