Questions tagged [spring-gem]

Rails application preloader

Spring speeds up development by keeping your application running in the background so you don't need to boot it every time you run a test, rake task or migration.

Features

  • Totally automatic; no need to explicitly start and stop the background process
  • Reloads your application code on each run
  • Restarts your application when configs / initializers / gem dependencies are changed

Compatibility

  • Ruby versions: MRI 1.9.3, MRI 2.0, MRI 2.1, MRI 2.2
  • Rails versions: 4.0+ (in Rails 4.1 and up Spring is included by default)

Spring makes extensive use of Process.fork, so won't be able to provide a speed up on platforms which don't support forking (, ).

30 questions
27
votes
3 answers

`spring rspec` just displays spring help.. why?

I'm trying to use spring with rspec and guard on a Rails 3.2.16 project. After installing spring and spring-commands-rspec, I created the binstubs with : > bundle exec spring binstub --all * bin/rake: spring inserted * bin/rspec: spring…
demental
  • 1,444
  • 13
  • 25
14
votes
1 answer

Rails 4.1 - Why Spring?

Now with Spring built-in with rails 4.1, I am curious about why the dev-team chose Spring over the others (Zeus and Spork). Why did they choose Spring?
karlingen
  • 13,800
  • 5
  • 43
  • 74
6
votes
1 answer

Spring: does "rails server" not start spring?

I'm just wondering: doesn't rails server start spring? It seems, that only rake or rails console starts spring. Is this normal behaviour, or do I have something misconfigured?
Joshua Muheim
  • 12,617
  • 9
  • 76
  • 152
5
votes
0 answers

Spring Rspec binstub not improving speed with Rails 5 RC1

I am using Rails 5 RC1. With the spring-commands-rspec gem (which hasn't been updated in a while at the time of writing), I have generated this spring rspec binstub in bin/rspec: #!/usr/bin/env ruby begin load File.expand_path('../spring',…
Jerome Dalbert
  • 10,067
  • 6
  • 56
  • 64
5
votes
2 answers

Running `gem pristine --all` ... will improve the startup performance of Spring. (doesn't actually do it)

I am running the Thin server for my Rails app locally. Every time I start it I receive the following message: Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle…
etayluz
  • 15,920
  • 23
  • 106
  • 151
5
votes
1 answer

Heroku deployment crash rails server syntax error File.expand_path("../spring", __FILE__)

When deploying on Heroku, the server crashes with this information rails server syntax error File.expand_path("../spring", FILE) though everything is working when working locally. Here is my rail file begin load File.expand_path("../spring",…
fro
  • 437
  • 4
  • 16
5
votes
2 answers

spring & rvm symlink alias commands to bin/

I use Rails 4 with spring & spring-commands-rspec gem. This question have relation to this: spring using by default When I run time rspec I get something like 5 seconds. If I run time bin/rspec I have 2 seconds. If I run time rake -T I get 3…
Alex Antonov
  • 14,134
  • 7
  • 65
  • 142
5
votes
2 answers

Rails 4 console with spring locked

I'm using Ruby 2.1.1 and Rails 4.1.0.rc1. When excute rails c, it's locked. Using Ctrl-C to stop, I got error logs belore: ~/.rvm/gems/ruby-2.1.1/gems/spring-1.1.2/lib/spring/client/run.rb:47:in `gets': Interrupt from…
swordray
  • 833
  • 9
  • 21
5
votes
3 answers

Spring doesn't work. [ uninitialized constant Spring::SID::DL ]

I Can't run Spring. Here is the error log. myid-no-MacBook-Pro:myid$ spring /Users/myid/.rbenv/versions/1.9.3-p484/lib/ruby/gems/1.9.1/gems/spring-0.0.10/lib/spring/sid.rb:17:in `fiddle_func': uninitialized constant Spring::SID::DL (NameError) …
tkymtk
  • 2,695
  • 3
  • 21
  • 37
4
votes
3 answers

Spring gem loaded in wrong environment

Why does my spring gem load in the wrong (or all) environment(s)? I have this in my Gemfile and spring gem is not listed anywhere else in the file: group :development do gem 'listen', '~> 3.1.5' # Spring speeds up development by keeping your…
konyak
  • 10,818
  • 4
  • 59
  • 65
4
votes
0 answers

Reduce Embedded Tomcat startup time on Prod profile

I am running a basic Jhipster generated app - see bottom for setup details - that is to be run on a single basic Heroku dyno for the time being. I use the embedded tomcat approach and all is working out fine apart from the start-up time on the…
3
votes
1 answer

Is it possible to clear the Spring gem's cache?

I'm trying to complete an assignment that creates a near identical application to a previous assignment. It calls for an application called todolists. This is the same as the previous assignment so, in order to be able to start fresh I renamed the…
theillien
  • 1,189
  • 3
  • 19
  • 33
3
votes
3 answers

How to resolve "Connection refused" when executing bin/rails (spring) commands?

I can execute rails-commands in production (FreeBSD 10) as long as Spring is disabled: # DISABLE_SPRING=1 bin/rails runner -e production 'p "test"' "test" # script/rails runner -e production 'p "test"' "test" With Spring, the rails-command fails…
user569825
  • 2,369
  • 1
  • 25
  • 45
2
votes
3 answers

Rails commands not working (spring gem error)

I'm honestly so lost. Every time I try to run any rails commands ie, rails g controller home, the command line throws me this error and I have no idea what's going on. I've uninstalled and reinstalled spring and I've also googled. Someone help…
Johnny Ji
  • 169
  • 2
  • 11
2
votes
0 answers

Rails spring server starting up when it is not supposed to and eating up ram on server

I noticed ruby processes (60!) eating up ram on my server... I saw most of them were spring processes which I did not want. See this: $ ps aux | grep spring david 30704 0.0 0.0 7832 836 pts/4 S+ 21:02 0:00 grep spring $ rails c -e…
davidhq
  • 4,660
  • 6
  • 30
  • 40
1
2