Questions tagged [rails-spring]

Spring is a Rails application preloader. It 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.

Spring is a Rails application preloader. It 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.

https://github.com/rails/spring

22 questions
15
votes
1 answer

Dockerized Rails 5 RC1 application not picking up updates to controllers and models in development

I have quite a bit of experience developing Rails 4 apps on Mac OS X + Docker Machine + Docker Compose, but something has changed with how Rails 5 is caching files in the development environment (currently testing with RC1). After starting the…
Chris Peters
  • 17,918
  • 6
  • 49
  • 65
12
votes
4 answers

Rails generate error: No such file or directory - getcwd

When running rails generate on a new Rails 4.2 project, I keep getting the error: ~/.rbenv/versions/2.2.0/lib/ruby/gems/2.2.0/gems/spring-1.3.0/lib/spring/configuration.rb:37:in `pwd': No such file or directory - getcwd (Errno::ENOENT) How can I…
Nick Urban
  • 3,568
  • 2
  • 22
  • 36
8
votes
1 answer

Spring stopping Rails console from running

I recently upgraded my Ruby to 2.5.0. Since then, I haven't been able to run the Rails Console properly. It either hangs indefinitely, or, after a few seconds, shows me this error: before_session hook failed: NoMethodError: undefined method…
Rockster160
  • 1,579
  • 1
  • 15
  • 30
5
votes
1 answer

docker-compose Rails spring doesn't work

I use Rail 4.2.5.1 running witin container Ruby 2.3.1 running wit container When I start $ docker-compose exec web /bin/bash # ssh into the web server $ bundle exec rails c I got the following error. from…
Toshi
  • 6,012
  • 8
  • 35
  • 58
5
votes
6 answers

Spring and middleware conflict?

I'm trying to add oauth2 with Google, following these instructions. I'm receiving the following error message starting the server: Exiting You've tried to invoke Spring when it's already loaded (i.e. the Spring constant is defined). This is…
5
votes
2 answers

How to transition from spork to spring?

I am currently using Spork with Guard, Rspec, and Cucumber. I'd like to move to Spring, but can't find any documentation on what I need to change. Specifically, I'm curious if I need to change out my: require 'spork' Spork.prefork do #…
Andrew
  • 227,796
  • 193
  • 515
  • 708
4
votes
0 answers

rspec using old files when rerunning tests

This is my first project in Rails 4, I'm using 4.2 I'm finding that rspec is not reloading my spec files each time it runs, so tests that I've fixed continue to fail with the old error message. I'm guessing this has something to do with spring but I…
ChrisJ
  • 2,486
  • 21
  • 40
3
votes
0 answers

Why does User.count return 0, until bin/spring is restarted in Ruby on Rails?

I run bundle exec rails c, It goes to development environment. When I do User.count I get 0 records. But after I do bin/spring stop and then bin/spring start, I see User.count records as 23782. Why is it so? What does spring do here? What are…
sofs1
  • 3,834
  • 11
  • 51
  • 89
3
votes
2 answers

Class variable reset with rails / spring

I've a class defined as such: class PublicationJob < ActiveJob::Base def self.jobs @jobs ||= Hash{|h, k| h[k] = []} end def self.register(format, job_class) jobs[format] << job_class end # [...] end To register different job…
Jaffa
  • 12,442
  • 4
  • 49
  • 101
3
votes
2 answers

How to speed up first request for local Rails UI tests

I am using spinach, Capybara, and Poltergeist together to write automated UI tests. I have been trying to speed up running tests locally. I am using Spring which helps a little with the environment loading. However, the first request (visit) to the…
gabe
  • 1,873
  • 2
  • 20
  • 36
2
votes
3 answers

guard-minitest + spring not working as expected

I have a rails 4.0.2 project and I'm using guard 4.7.5, guard-minitest 2.2.0, and spring 1.1.0. When my Guardfile reads: guard :minitest, spring: true do … end I get spring usage info when running guard. As per the guard-minitest README, if my…
1
vote
0 answers

Cannot start rails console unless spring is disabled

My rails development environment runs in Docker, and I cannot start the rails console without disabling spring using DISABLE_SPRING=true. The snipper below illustrates what happens: app@docker:[project] $ bundle exec rails c Could not find…
Dave Isaacs
  • 4,499
  • 6
  • 31
  • 44
1
vote
1 answer

Rails: how to tell if Spring is loaded

In recent versions of Rails they've set config.cache_classes = true in config/environments/test.rb. This makes sense to me, as we won't typically be dynamically reloading classes. However, when we run with Spring, it complains that this should be…
lobati
  • 9,284
  • 5
  • 40
  • 61
1
vote
1 answer

How to set class level variables in Rails initializer when using spring?

In my config/initializers/transaction_logger.rb I have the following code # config/initializers/transaction_logger.rb Transaction::Logger.logger = Transaction::Logger.new("log/transations.log") Every time I change the code and run the tests I get: …
Hirurg103
  • 4,783
  • 2
  • 34
  • 50
1
vote
0 answers

Rails spring testunit Bad file descriptor

I'm trying to use spring 1.4.0 with rails 3.2.22/ruby 2.2.5, and doing : bundle exec spring testunit outputs this : /Users/igor/.rbenv/versions/2.2.5/gemsets//gems/spring-1.4.0/lib/spring/application/boot.rb:7:in 'for_fd': Bad…
grdscrc
  • 11
  • 1
1
2