RubyMine 6.3.3 with Spring fails on getpgid: No such process

This first happened on an existing project upgrading to Rails 4.1, but I confirmed that it occurs with a new project too.

RubyMine 6.3.3, running on RHEL 6.5.
After creating a brand new Rails project (File->New Project...), selecting Rails application and then RVM ruby-2.0.0-p353, Rails 4.1.6, anything that's supposed to run with Spring (such as Rake) dies on a line related to Spring looking for the process group ID. I've pasted a slightly redacted stack trace from trying to reload Rake tasks at the bottom.

I couldn't find any other reports of this exact issue, so I'm not sure if this is a bug or I'm doing something wrong somehow. I did find https://github.com/rails/spring/issues/231, which has the same error but in a different situation (running under Jenkins). In that case, one of the maintainers of Spring said:

I presume this is happening because there's no associated terminal, and therefore

Process.getsid
is returning 0 or nil or something. Spring isn't really designed to be  run outside of terminal environments, so I'm closing this.
I don't know if there's a similar issue with RubyMine's handling of Spring?

I can go to the RubyMine Terminal tab and run something in Spring with no problems. And once I've started the Spring server by doing that, I can run Rake tasks and Rails generators through RubyMine. However in that case, Rspec fails (even after adding the spring-commands-rspec gem) with an error related to the TeamCity formatter (same error as in https://youtrack.jetbrains.com/issue/RUBY-15287), unless I set the RUBYLIB environment variable in the terminal before running Spring (see https://gist.github.com/tomasv/5095700#file-rspec-configuration-L2).

Any suggestions?

Stack trace (slightly redacted) from trying to reload Rake tasks:
Error:[rake --tasks] /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/sid.rb:39:in `getpgid': No such process (Errno::ESRCH)
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/sid.rb:39:in `pgid'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/server.rb:78:in `set_pgid'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/server.rb:34:in `boot'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/server.rb:14:in `boot'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client/run.rb:43:in `block in boot_server'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client/run.rb:41:in `fork'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client/run.rb:41:in `boot_server'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client/run.rb:24:in `call'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
    from [home directory]/RubymineProjects/spring_test/bin/spring:16:in `require'
    from [home directory]/RubymineProjects/spring_test/bin/spring:16:in `<top (required)>'
    from [home directory]/RubymineProjects/spring_test/bin/rake:3:in `load'
    from [home directory]/RubymineProjects/spring_test/bin/rake:3:in `<main>'

Error:[rake --prereqs] /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/sid.rb:39:in `getpgid': No such process (Errno::ESRCH)
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/sid.rb:39:in `pgid'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/server.rb:78:in `set_pgid'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/server.rb:34:in `boot'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/server.rb:14:in `boot'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client/run.rb:43:in `block in boot_server'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client/run.rb:41:in `fork'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client/run.rb:41:in `boot_server'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client/run.rb:24:in `call'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client/command.rb:7:in `call'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/client.rb:26:in `run'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/bin/spring:48:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `load'
    from /usr/local/rvm/gems/ruby-2.0.0-p353/gems/spring-1.1.3/lib/spring/binstub.rb:11:in `<top (required)>'
    from [home directory]/RubymineProjects/spring_test/bin/spring:16:in `require'
    from [home directory]/RubymineProjects/spring_test/bin/spring:16:in `<top (required)>'
    from [home directory]/RubymineProjects/spring_test/bin/rake:3:in `load'
    from [home directory]/RubymineProjects/spring_test/bin/rake:3:in `<main>'
3 comments

Hi,

it looks like something new in current version of spring (1.1.3)
As a workaround I'd suggest to try to use spring 1.0 and see if this helps.
Also could you please file a bug in our tracker (https://youtrack.jetbrains.com/issues/RUBY) and we will see what we can do with this problem.

Regards, Oleg.

0

After downgrading to 1.0, sometimes the Rake task reload works, but then any actual Rake task still fails, either with the same error (if there are no binstubs) or with an error that says it cannot load 'spring/binstub' from bin/spring (if there are binstubs).

I will file a bug report. Thanks!

0

Please sign in to leave a comment.