0

I upgraded rails to 4.1.0 & installed gem "spring"

After it, I patched bundle exec spring binstub --all. Now, all my bin/* includes

begin
  load File.expand_path("../spring", __FILE__)
rescue LoadError
end

But, if I run, saying time spring rake -T & time rake -T times 1 second & 3 seconds! It seems that spring not used by default in my application. What's going wrong? It's bad thing that I need to write annoying spring ..command.. before any rake task, rails server or rspec. What I need to do to avoid spring command with spring worked by default?

Alex Antonov
  • 14,134
  • 7
  • 65
  • 142

1 Answers1

2

You don't need to prepend spring everytime. I'm not sure why you're getting those numbers but try the following.

# make sure that spring server is stopped
>> spring stop

# take note of the time here
>> time bin/rake routes

# start spring server
>> spring

# test routes again
>> time bin/rake routes

The second bin/rake routes should be very fast. In one of our apps, without spring, it takes 8 seconds to show the routes. With spring, it's less than a second.

For rspec, you need to install an additional gem for that. Look at the additional commands section of the spring gem

jvnill
  • 29,479
  • 4
  • 83
  • 86
  • 1
    It seems true, but what about rvm? I don't want to paste bin/rake, I need to print just rake. I tried solutions from the internet, but they don't work. Do you know solution? – Alex Antonov Apr 24 '14 at 05:48