Ruby on Rails boot time

Asked

Viewed 210 times

4

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

Updating

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

But as we spin bundle exec spring binstub -all, as it suggests 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) just removes the alert, but still gives the same error.

I tried using Ruby 1.9.3 and got exactly the same error. Run gem update --system didn’t help here either.

  • Try updating rubygems as it prompts for the error message: Gem update --system

  • But already be ready to be frustrated, much of the slowness that you are facing comes from being using ruby in windows, unfortunately does not work well.

  • @Alextakitani This removes the alert, but still gives the same error. Idem in Ruby 1.9.3.

  • It may be that you are using the old version of rubygems, try to install the latest version

  • Unfortunately, neither Zeus nor Spring work in windows, both use Fork that only works on *Nix. I recommend developing in linux, this was just one of thousands of problems you will find developing in windows, own experience.

1 answer

1


Zeus and Spring that would help with the boot time of Rails, depend on Fork that only works on *Nix systems.

I recommend you migrate your development environment to linux.

I started developing in Rails in windows, and the problems with incompatible Gems made me first, develop in VM, if it is the best option for vc, the Vagrant http://www.vagrantup.com/ plenty of help.

If you have no reason to stay in windows, migrating to linux will give you many advantages besides ruby speed and compatibility.

Unfortunately there doesn’t seem to be much community interest in compatibility / performance in windows.

  • @Alextakitani I updated my question.

  • @Alextakitani Bad for Windows people, that stays in the hand. = ( I think the way is to continue anyway, because running everything in Virtualbox would make everything much slower still. (On my machine Windows runs very fast on Virtualbox, but Ubuntu and Mint are extremely slow, I aim to take several seconds to do simple things like open a right-click menu, for example. = ( ). As for the incompatibilities of Gems, so far I only had problems with Spring itself and Zeus, otherwise everything worked. I thank you for your patience. =)

  • Andrey, do not run graphical environment on vm, run in text mode, access via ssh, share a folder, and run the rest on windows same.http://simplesideias.com.br/usando-o-vagrant-environment-developmental

Browser other questions tagged

You are not signed in. Login or sign up in order to post.