Test boot time in Ruby on Rails

4

In Ruby on Rails, using the Minitest library, the runtime of the tests is fast. But the boot time before each rake test (...) is very annoying. Is there any way to make it faster?

Update

I tried to install Spring here ( gem 'spring', group: :development ) as suggested by @AlexTakitani.

But when running bundle exec spring binstub -all , as suggested their page I get the following error:

C:\Sites\**<meu_app>**>bundle exec spring binstub --all
DL is deprecated, please use Fiddle
Warning: You're using Rubygems 2.0.2 with Spring. Upgrade to at least Rubygems 2
.1.0 and run 'gem pristine --all' for better startup performance.
C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/lib/ruby/gems/2.0.0/g
ems/spring-1.1.2/lib/spring/env.rb:19:in 'initialize': No such file or directory
 - /dev/null (Errno::ENOENT)
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/lib/ruby
/gems/2.0.0/gems/spring-1.1.2/lib/spring/env.rb:19:in 'open'
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/lib/ruby
/gems/2.0.0/gems/spring-1.1.2/lib/spring/env.rb:19:in 'initialize'
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/lib/ruby
/gems/2.0.0/gems/spring-1.1.2/lib/spring/client/command.rb:14:in 'new'
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/lib/ruby
/gems/2.0.0/gems/spring-1.1.2/lib/spring/client/command.rb:14:in 'initialize'
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/lib/ruby
/gems/2.0.0/gems/spring-1.1.2/lib/spring/client/binstub.rb:136:in 'initialize'
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/lib/ruby
/gems/2.0.0/gems/spring-1.1.2/lib/spring/client/command.rb:7:in 'new'
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/lib/ruby
/gems/2.0.0/gems/spring-1.1.2/lib/spring/client/command.rb:7:in 'call'
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/lib/ruby
/gems/2.0.0/gems/spring-1.1.2/lib/spring/client/binstub.rb:132:in 'call'
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/lib/ruby
/gems/2.0.0/gems/spring-1.1.2/lib/spring/client.rb:26:in 'run'
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/lib/ruby
/gems/2.0.0/gems/spring-1.1.2/bin/spring:48:in '<top (required)>'
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/bin/spri
ng:23:in 'load'
        from C:/Users/*****<meu_usuário>*****/.pik/rubies/Ruby-200-p195/bin/spri
ng:23:in '<main>'

Update 2

In Ruby 2.0.0, updating RubyGems ( gem update --system ) only removes the alert, but still gives the same error.

I tried using Ruby 1.9.3 and got exactly the same error. Turning gem update --system did not work here either.

    
asked by anonymous 06.05.2014 / 15:47

1 answer

1

Zeus and Spring that would help with rails boot time depend on fork that only works on * nix systems.

I recommend that you migrate your development environment to linux.

I started developing in Rails on windows, and the problems with incompatible gems did me first, develop in VM, if it is the best option for you, the Vagrant link helps a lot.

If you have no reason to stay on windows, migrating to linux will give you many advantages beyond the speed and compatibility of ruby.

Unfortunately there does not seem to be much community interest in compatibility / performance on windows.

    
06.05.2014 / 18:47