gpt4 book ai didi

ruby-on-rails - 在本地启动 Rails 服务器时出错 - Puma - runner.rb :103:in `reopen' - No such file or directory @ rb_io_reopen

转载 作者:数据小太阳 更新时间:2023-10-29 08:07:25 24 4
gpt4 key购买 nike

我在尝试在本地启动 Rails 服务器时遇到以下错误。生产环境中的存储库工作正常。生产中的最新版本被克隆到本地。唯一的变化是 gemfile 中的 rails 版本;从 ruby “2.2.1”更改为 ruby “2.2.3”。 bundle 更新后,在尝试启动 Rails 服务器时会显示此问题/错误。

I am using a mac, the users directory is Users/circle. (issue could be related to puma version, rvm version and gem file versions). But any hints and suggestions in this regards would be greatly appreciated. 

[3951] Puma starting in cluster mode...
[3951] * Version 3.2.0 (ruby 2.2.3-p173), codename: Spring Is A Heliocentric Viewpoint
[3951] * Min threads: 1, max threads: 6
[3951] * Environment: development
[3951] * Process workers: 2
[3951] * Phased restart available
[3951] * Listening on tcp://localhost:3000
[3951] Use Ctrl-C to stop

/Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/puma-3.2.0/lib/puma/runner.rb:103:in `reopen': No such file or directory @ rb_io_reopen - /Users/circle/Test_new/testdirectory/shared/log/puma.stdout.log (Errno::ENOENT)
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/puma-3.2.0/lib/puma/runner.rb:103:in `redirect_io'
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/puma-3.2.0/lib/puma/cluster.rb:40:in `redirect_io'
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/puma-3.2.0/lib/puma/cluster.rb:408:in `run'
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/puma-3.2.0/lib/puma/launcher.rb:172:in `run'
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/puma-3.2.0/lib/rack/handler/puma.rb:51:in `run'
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-1.6.4/lib/rack/server.rb:286:in `start'
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/server.rb:80:in `start'
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/circle/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/railties-4.2.6/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

最佳答案

将生产环境中的 gemfile.lock 替换到本地存储库中确实解决了问题。发布之后,我已经能够在本地主机上启动并运行 Rails 服务器。

这实际上意味着,对于某些文件,需要完全相同版本的相关库,而不仅仅是来自 gem 文件和包更新的最新版本。因为,Gemfile.lock 是 Git 忽略的文件之一。因此,它在克隆时没有在本地更新。它必须以独占方式获取并在本地存储库中替换。 bundle 更新,发布后,一切正常。

感谢所有回复的人。

关于ruby-on-rails - 在本地启动 Rails 服务器时出错 - Puma - runner.rb :103:in `reopen' - No such file or directory @ rb_io_reopen,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36195923/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com