尝试在产品中打开控制台 rails 时出错

Error when trying openning console rails in prod

我正在使用 rails 4.2.0
我正在使用 ruby : ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-linux]
和 rbenv :rbenv 0.4.0-129-g7e0e85b

当我尝试在生产控制台中打开 rails c 时,出现以下错误:

~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/env.rb:69:in `initialize': Permission denied @ rb_sysopen - /tmp/spring/71079e88c49df6873d86594ca3ada123.pid (Errno::EACCES)
  from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/env.rb:69:in `open'
  from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/env.rb:69:in `open'
  from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/env.rb:69:in `server_running?'
  from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/client/run.rb:25:in `call'
  from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/client/command.rb:7:in `call'
  from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/client/rails.rb:23:in `call'
  from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/client/command.rb:7:in `call'
  from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/client.rb:26:in `run'
  from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/bin/spring:48:in `<top (required)>'
  from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/binstub.rb:11:in `load'
  from ~/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/spring-1.3.3/lib/spring/binstub.rb:11:in `<top (required)>'
  from ~/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  from ~/.rbenv/versions/2.1.0/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  from /var/www/site/bin/spring:16:in `<top (required)>'
  from bin/rails:3:in `load'
  from bin/rails:3:in `<main>'

我有更新包,但没有任何变化。怎么了?

你们制作组里面有springgem吗?

Spring 应该只在测试和开发中。例如

group :development, :test do
  gem 'spring'
end

修复方式: sudo chmod -R 1777 /tmp

并重启 spring。