{"id":3138,"date":"2025-12-26T00:00:41","date_gmt":"2025-12-25T15:00:41","guid":{"rendered":"https:\/\/blog.id774.net\/entry\/?p=3138"},"modified":"2025-12-26T00:00:41","modified_gmt":"2025-12-25T15:00:41","slug":"ruby-4-0-%e6%96%b0%e6%a9%9f%e8%83%bd%e3%81%a8-ruby-3-x-%e7%b3%bb%e3%82%b3%e3%83%bc%e3%83%89%e3%81%ae%e4%ba%92%e6%8f%9b%e6%80%a7%e7%b6%ad%e6%8c%81%e3%81%a7%e6%b3%a8%e6%84%8f%e3%81%99%e3%81%b9%e3%81%8d","status":"publish","type":"post","link":"https:\/\/blog.id774.net\/entry\/2025\/12\/26\/3138\/","title":{"rendered":"Ruby 4.0 \u65b0\u6a5f\u80fd\u3068 Ruby 3.x \u7cfb\u30b3\u30fc\u30c9\u306e\u4e92\u63db\u6027\u7dad\u6301\u3067\u6ce8\u610f\u3059\u3079\u304d\u70b9"},"content":{"rendered":"<p>\u6628\u65e5 <a href=\"https:\/\/www.ruby-lang.org\/ja\/news\/2025\/12\/25\/ruby-4-0-0-released\/\">Ruby 4.0 \u304c\u30ea\u30ea\u30fc\u30b9<\/a>\u3055\u308c\u305f\u3002\u6700\u8fd1\u306f\u3082\u3063\u3071\u3089 <a href=\"https:\/\/www.python.org\/\">Python<\/a> \u3070\u304b\u308a\u4f7f\u3063\u3066\u3044\u308b\u304c\u3001\u304b\u3064\u3066\u306f Ruby \u3092\u3088\u304f\u4f7f\u3063\u3066\u3044\u305f\u3053\u3068\u3082\u3042\u308a\u3001\u65b0\u6a5f\u80fd\u53ca\u3073\u3001\u4eca\u5f8c\u306e Ruby \u30b9\u30af\u30ea\u30d7\u30c8\u4fdd\u5b88\u306e\u305f\u3081\u4e92\u63db\u6027\u7dad\u6301\u306e\u305f\u3081\u306b\u6c17\u3092\u3064\u3051\u306a\u3051\u308c\u3070\u306a\u3089\u306a\u3044\u70b9\u3092\u307e\u3068\u3081\u3088\u3046\u3068\u601d\u3046\u3002\u672c\u7a3f\u3067\u306f\u3001\u307e\u305a Ruby 4.0 \u306e\u65b0\u6a5f\u80fd\u3092\u4fef\u77b0\u3057\u3001\u305d\u306e\u3046\u3048\u3067\u300cRuby 3.x \u3092\u524d\u63d0\u3068\u3057\u305f\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3082\u306e\u300d\u306b\u3068\u3063\u3066\u79fb\u884c\u6642\u30fb\u4fdd\u5b88\u6642\u306b\u3069\u3053\u3092\u8b66\u6212\u3059\u3079\u304d\u304b\u3092\u3001\u51fa\u5178\u3092\u660e\u8a18\u3057\u3064\u3064\u6574\u7406\u3059\u308b\u3002<\/p>\n<hr>\n<h2>Ruby 4.0 \u306e\u65b0\u6a5f\u80fd\uff08\u4fef\u77b0\uff09<\/h2>\n<h3>1. Ruby Box\uff08Ruby::Box\uff09: \u540d\u524d\u7a7a\u9593\uff0f\u5b9a\u7fa9\u306e\u5206\u96e2\u6a5f\u69cb\uff08\u5b9f\u9a13\u7684\uff09<\/h3>\n<p>Ruby 4.0 \u306f \u201cRuby Box\u201d \u3092\u5c0e\u5165\u3059\u308b\u3002\u74b0\u5883\u5909\u6570 RUBY_BOX=1 \u3067\u6709\u52b9\u5316\u3055\u308c\u3001Ruby::Box \u306b\u3088\u308a\u300c\u5b9a\u7fa9\u306e\u5206\u96e2\uff08isolation\uff09\u300d\u3092\u63d0\u4f9b\u3059\u308b\u5b9f\u9a13\u7684\u6a5f\u80fd\u3067\u3042\u308b\u3002\u30e2\u30f3\u30ad\u30fc\u30d1\u30c3\u30c1\u3084\u30b0\u30ed\u30fc\u30d0\u30eb\uff0f\u30af\u30e9\u30b9\u5909\u6570\u3001\u30af\u30e9\u30b9\uff0f\u30e2\u30b8\u30e5\u30fc\u30eb\u5b9a\u7fa9\u3001\u30ed\u30fc\u30c9\u3057\u305f Ruby\uff0f\u30cd\u30a4\u30c6\u30a3\u30d6\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\u5f71\u97ff\u3092 Box \u5358\u4f4d\u306b\u9694\u96e2\u3067\u304d\u308b\u3053\u3068\u304c\u76ee\u7684\u3068\u3057\u3066\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u3002\u516c\u5f0f\u306e\u30ea\u30ea\u30fc\u30b9\u544a\u77e5\u3082 \u201cRuby Box is a new (experimental) feature to provide separation about definitions\u201d \u3068\u660e\u793a\u3057\u3066\u3044\u308b\u3002<\/p>\n<ul>\n<li>\u516c\u5f0f: <a href=\"https:\/\/www.ruby-lang.org\/en\/news\/2025\/12\/25\/ruby-4-0-0-released\/\">Ruby 4.0.0 Released<\/a><\/li>\n<li>\u516c\u5f0f\uff08preview3\uff09: <a href=\"https:\/\/www.ruby-lang.org\/en\/news\/2025\/12\/18\/ruby-4-0-0-preview3-released\/\">Ruby 4.0.0 preview3 Released<\/a><\/li>\n<\/ul>\n<h3>2. ZJIT: \u65b0\u3057\u3044 JIT\uff08\u5b9f\u9a13\u7684\uff09<\/h3>\n<p>Ruby 4.0 \u306f \u201cZJIT\u201d \u3092\u5c0e\u5165\u3059\u308b\u3002\u516c\u5f0f\uff08preview3 \u65e5\u672c\u8a9e\uff09\u3067\u306f\u300c\u5b9f\u9a13\u7684\u306a\u30e1\u30bd\u30c3\u30c9\u30d9\u30fc\u30b9\u306e JIT\u300d\u3068\u8aac\u660e\u3055\u308c\u3001&#8211;zjit \u30d5\u30e9\u30b0\u3067\u5229\u7528\u3067\u304d\u308b\u3053\u3068\u3001\u30d3\u30eb\u30c9\u306b Rust 1.85.0 \u4ee5\u964d\u304c\u5fc5\u8981\u306a\u3053\u3068\u3001Ruby 4.0.0 \u6642\u70b9\u3067\u306f\u30a4\u30f3\u30bf\u30d7\u30ea\u30bf\u3088\u308a\u901f\u3044\u304c YJIT \u307b\u3069\u901f\u304f\u306a\u3044\u3053\u3068\u3001\u73fe\u6642\u70b9\u3067\u306f\u672c\u756a\u5c0e\u5165\u3092\u907f\u3051\u308b\u3079\u304d\u3067\u3042\u308b\u3053\u3068\u3001Ruby 4.1 \u3067\u6539\u5584\u3057\u3066\u672c\u756a\u5229\u7528\u53ef\u80fd\u306b\u3059\u308b\u76ee\u6a19\u304c\u8ff0\u3079\u3089\u308c\u3066\u3044\u308b\u3002<\/p>\n<ul>\n<li>\u516c\u5f0f\uff08preview3 \u65e5\u672c\u8a9e\uff09: <a href=\"https:\/\/www.ruby-lang.org\/ja\/news\/2025\/12\/18\/ruby-4-0-0-preview3-released\/\">Ruby 4.0.0 preview3 \u30ea\u30ea\u30fc\u30b9<\/a><\/li>\n<li>\u6982\u89b3\uff08\u88dc\u52a9\uff09: <a href=\"https:\/\/blog.saeloun.com\/2025\/12\/24\/what-is-new-in-ruby-4\/\">What Is New In Ruby 4.0<\/a><\/li>\n<\/ul>\n<h3>3. Ractor \u306e\u6539\u5584\uff08Ractor::Port \u3092\u4e2d\u5fc3\u3068\u3057\u305f API \u518d\u8a2d\u8a08\uff09<\/h3>\n<p>Ractor\uff08\u4e26\u5217\u5b9f\u884c\u6a5f\u69cb\uff09\u306b API \u518d\u8a2d\u8a08\u304c\u5165\u3063\u3066\u3044\u308b\u3002\u4e92\u63db\u6027\u9762\u3067\u306f\u3001Ractor::Port \u5c0e\u5165\u306b\u4f34\u3044\u8907\u6570\u306e API \u304c\u524a\u9664\u3055\u308c\u3066\u3044\u308b\uff08\u8a73\u7d30\u306f\u5f8c\u8ff0\uff09\u3002<\/p>\n<ul>\n<li>\u4e92\u63db\u6027\u306e\u8981\u70b9\uff08\u524a\u9664 API \u660e\u793a\uff09: <a href=\"https:\/\/fedoraproject.org\/wiki\/Changes\/Ruby_4.0\">Fedora Changes\/Ruby 4.0<\/a><\/li>\n<li>\u6982\u89b3\uff08\u88dc\u52a9\uff09: <a href=\"https:\/\/blog.saeloun.com\/2025\/12\/24\/what-is-new-in-ruby-4\/\">What Is New In Ruby 4.0<\/a><\/li>\n<\/ul>\n<h3>4. \u8a00\u8a9e\u4ed5\u69d8\u306e\u5909\u66f4\uff08\u4f8b: *nil \/ \u884c\u982d\u8ad6\u7406\u6f14\u7b97\u5b50\uff09<\/h3>\n<p>Ruby 4.0 \u306e\u8a00\u8a9e\u4ed5\u69d8\u5909\u66f4\u3068\u3057\u3066\u3001\u5c11\u306a\u304f\u3068\u3082\u4ee5\u4e0b\u304c\u516c\u5f0f NEWS \u306b\u660e\u8a18\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<ul>\n<li>*nil \u306f nil.to_a \u3092\u547c\u3073\u51fa\u3055\u306a\u304f\u306a\u3063\u305f\uff08**nil \u304c nil.to_hash \u3092\u547c\u3073\u51fa\u3055\u306a\u3044\u306e\u3068\u540c\u69d8\uff09\u3002<\/li>\n<li>\u884c\u982d\u306e\u8ad6\u7406\u4e8c\u9805\u6f14\u7b97\u5b50\uff08||, &#038;&#038;, and, or\uff09\u304c\u524d\u884c\u304b\u3089\u306e\u7d99\u7d9a\u3068\u3057\u3066\u6271\u308f\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f\uff08fluent dot \u3068\u540c\u69d8\uff09\u3002<\/li>\n<\/ul>\n<ul>\n<li>\u516c\u5f0f NEWS: <a href=\"https:\/\/docs.ruby-lang.org\/en\/master\/NEWS_md.html\">NEWS for Ruby 4.0.0<\/a><\/li>\n<li>\u516c\u5f0f\uff08preview3 \u65e5\u672c\u8a9e\uff09: <a href=\"https:\/\/www.ruby-lang.org\/ja\/news\/2025\/12\/18\/ruby-4-0-0-preview3-released\/\">Ruby 4.0.0 preview3 \u30ea\u30ea\u30fc\u30b9<\/a><\/li>\n<\/ul>\n<hr>\n<h2>\u53c2\u7167<\/h2>\n<ul>\n<li>Ruby 4.0.0 Released\uff08\u516c\u5f0f\u30ea\u30ea\u30fc\u30b9\u544a\u77e5\uff09: <a href=\"https:\/\/www.ruby-lang.org\/en\/news\/2025\/12\/25\/ruby-4-0-0-released\/\">ruby-lang.org<\/a><\/li>\n<li>NEWS for Ruby 4.0.0\uff08Ruby \u516c\u5f0f NEWS\uff09: <a href=\"https:\/\/docs.ruby-lang.org\/en\/master\/NEWS_md.html\">docs.ruby-lang.org<\/a><\/li>\n<li>Ruby 4.0.0 preview3 \u30ea\u30ea\u30fc\u30b9\uff08\u8a00\u8a9e\u4ed5\u69d8\u30fbZJIT\u6ce8\u610f\u7b49\u306e\u8981\u7d04\u3042\u308a\u3001\u65e5\u672c\u8a9e\uff09: <a href=\"https:\/\/www.ruby-lang.org\/ja\/news\/2025\/12\/18\/ruby-4-0-0-preview3-released\/\">ruby-lang.org\uff08ja\uff09<\/a><\/li>\n<li>Fedora \u201cChanges\/Ruby 4.0\u201d\uff08\u4e92\u63db\u6027\u30fbstdlib\u30fbC API \u3092\u8981\u70b9\u5316\uff09: <a href=\"https:\/\/fedoraproject.org\/wiki\/Changes\/Ruby_4.0\">fedoraproject.org<\/a><\/li>\n<li>Reading Ruby 4.0 NEWS with Pros\uff08NEWS \u3092\u8aad\u307f\u89e3\u304f\u6280\u8853\u8a18\u4e8b\uff09: <a href=\"https:\/\/dev.to\/ko1\/reading-ruby-40-news-with-pros-3mln\">dev.to<\/a><\/li>\n<li>cgi library is removed from default gem\uff08CGI \u5909\u66f4\u70b9\u306e\u89e3\u8aac\uff09: <a href=\"https:\/\/zenn.dev\/mamayukawaii\/articles\/20251207204749\">zenn.dev<\/a><\/li>\n<li>What Is New In Ruby 4.0\uff08\u6982\u89b3\u8a18\u4e8b\u3001\u88dc\u52a9\u53c2\u7167\uff09: <a href=\"https:\/\/blog.saeloun.com\/2025\/12\/24\/what-is-new-in-ruby-4\/\">saeloun blog<\/a><\/li>\n<\/ul>\n<hr>\n<h2>Ruby 3.x \u524d\u63d0\u30b3\u30fc\u30c9\u306e\u79fb\u884c\u30fb\u4e92\u63db\u6027\u7dad\u6301\u3067\u6ce8\u610f\u3059\u308b\u3079\u304d\u70b9<\/h2>\n<p>\u4ee5\u4e0b\u306f\u3001\u65b0\u6a5f\u80fd\u3067\u306f\u306a\u304f\u300cRuby 3.x \u524d\u63d0\u306e\u65e2\u5b58\u30b3\u30fc\u30c9\u304c Ruby 4.0 \u3067\u58ca\u308c\u3084\u3059\u3044\u7b87\u6240\u300d\u300c\u4fdd\u5b88\u89b3\u70b9\u3067\u5dee\u5206\u304c\u52b9\u3044\u3066\u304f\u308b\u7b87\u6240\u300d\u3092\u4e2d\u5fc3\u306b\u307e\u3068\u3081\u308b\u3002\u5b9f\u52d9\u4e0a\u306f\u8a00\u8a9e\u6a5f\u80fd\u3088\u308a\u3082\u3001\u6a19\u6e96\u6dfb\u4ed8\u30e9\u30a4\u30d6\u30e9\u30ea\u3001\u5468\u8fba\u30c4\u30fc\u30eb\u3001\u975e\u63a8\u5968\u2192\u524a\u9664\u306e\u79fb\u884c\u304c\u4e3b\u6226\u5834\u306b\u306a\u308a\u3084\u3059\u3044\u3002<\/p>\n<hr>\n<h2>1) \u6a19\u6e96\u6dfb\u4ed8\u30e9\u30a4\u30d6\u30e9\u30ea\uff08stdlib \/ default gems\uff09\u7531\u6765\u306e\u4e92\u63db\u6027\u554f\u984c<\/h2>\n<h3>CGI \u30e9\u30a4\u30d6\u30e9\u30ea\u304c default gems \u304b\u3089\u524a\u9664<\/h3>\n<p>Ruby 4.0 \u3067\u306f CGI \u30e9\u30a4\u30d6\u30e9\u30ea\u304c default gems \u304b\u3089\u524a\u9664\u3055\u308c\u3001\u5f93\u6765\u306e require &#8216;cgi&#8217; \u3092\u524d\u63d0\u3068\u3059\u308b\u30b3\u30fc\u30c9\u306f\u6ce8\u610f\u304c\u5fc5\u8981\u306b\u306a\u308b\u3002Fedora \u306e\u4e92\u63db\u6027\u30e1\u30e2\u3067\u306f\u300cCGI library is removed from the default gems\u300d\u3068\u660e\u8a18\u3055\u308c\u3001\u63d0\u4f9b\u3055\u308c\u308b\u306e\u306f cgi\/escape \u306e\u4e00\u90e8\u30e1\u30bd\u30c3\u30c9\u7fa4\u306e\u307f\u3068\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<p>Zenn \u306e\u89e3\u8aac\u8a18\u4e8b\u3067\u306f\u3001Ruby 4.0 \u3067 require &#8216;cgi&#8217; \u3059\u308b\u3068\u8b66\u544a\u304c\u51fa\u308b\u3053\u3068\u3001CGI.new \u306e\u3088\u3046\u306a\u30d5\u30eb\u6a5f\u80fd\u5229\u7528\u304c\u30a8\u30e9\u30fc\u306b\u306a\u308a\u5f97\u308b\u3053\u3068\u3001\u4eca\u5f8c\u306f require &#8216;cgi\/escape&#8217; \u3092\u7528\u3044\u308b\u3053\u3068\u3001\u30d5\u30eb\u6a5f\u80fd\u304c\u5fc5\u8981\u306a\u3089 Gemfile \u306b gem &#8216;cgi&#8217; \u3092\u660e\u793a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3053\u3068\u304c\u3001\u5177\u4f53\u4f8b\u8fbc\u307f\u3067\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<ul>\n<li>\u4e92\u63db\u6027\u30e1\u30e2: <a href=\"https:\/\/fedoraproject.org\/wiki\/Changes\/Ruby_4.0\">Fedora Changes\/Ruby 4.0<\/a><\/li>\n<li>\u89e3\u8aac: <a href=\"https:\/\/zenn.dev\/mamayukawaii\/articles\/20251207204749\">cgi \u30e9\u30a4\u30d6\u30e9\u30ea\u304c default gem \u304b\u3089\u524a\u9664\u3055\u308c\u308b\uff08Zenn\uff09<\/a><\/li>\n<\/ul>\n<h3>SortedSet \u304c\u81ea\u52d5\u30ed\u30fc\u30c9\u3055\u308c\u306a\u304f\u306a\u308b\uff08set\/sorted_set.rb \u306e\u524a\u9664\uff09<\/h3>\n<p>Set \u304c stdlib \u304b\u3089\u30b3\u30a2\u5074\u3078\u79fb\u308b\u6d41\u308c\u306e\u4e2d\u3067\u3001set\/sorted_set.rb \u304c\u524a\u9664\u3055\u308c\u3001SortedSet \u306f autoload \u3055\u308c\u306a\u3044\u5b9a\u6570\u306b\u306a\u3063\u305f\u3002Fedora \u306e\u30e1\u30e2\u306f\u3001SortedSet \u3092\u4f7f\u3046\u306a\u3089 sorted_set gem \u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057 require &#8216;sorted_set&#8217; \u304c\u5fc5\u8981\u3060\u3068\u660e\u8a18\u3057\u3066\u3044\u308b\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/fedoraproject.org\/wiki\/Changes\/Ruby_4.0\">Fedora Changes\/Ruby 4.0<\/a><\/li>\n<\/ul>\n<hr>\n<h2>2) Ractor \u5229\u7528\u30b3\u30fc\u30c9\u306f API \u524a\u9664\u304c\u76f4\u6483\u3059\u308b<\/h2>\n<p>Ractor::Port \u5c0e\u5165\u306b\u4f34\u3044\u3001\u4ee5\u4e0b\u306e API \u304c\u524a\u9664\u3055\u308c\u3066\u3044\u308b\uff08\u4e92\u63db\u6027\u30e1\u30e2\u3067\u660e\u793a\uff09\u3002Ractor \u3092\u4e26\u5217\u51e6\u7406\u306e\u57fa\u76e4\u3068\u3057\u3066\u4f7f\u3063\u3066\u3044\u308b\u30b3\u30fc\u30c9\u306f\u3001\u3053\u308c\u3089\u306e\u547c\u3073\u51fa\u3057\u304c\u5b58\u5728\u3057\u306a\u3044\u304b\u3092\u307e\u305a\u78ba\u8a8d\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002<\/p>\n<ul>\n<li>Ractor.yield<\/li>\n<li>Ractor#take<\/li>\n<li>Ractor#close_incoming<\/li>\n<li>Ractor#close_outgoging\uff08\u539f\u6587\u8868\u8a18\uff09<\/li>\n<\/ul>\n<ul>\n<li><a href=\"https:\/\/fedoraproject.org\/wiki\/Changes\/Ruby_4.0\">Fedora Changes\/Ruby 4.0<\/a><\/li>\n<li>\u6982\u89b3\uff08\u88dc\u52a9\uff09: <a href=\"https:\/\/blog.saeloun.com\/2025\/12\/24\/what-is-new-in-ruby-4\/\">What Is New In Ruby 4.0<\/a><\/li>\n<\/ul>\n<hr>\n<h2>3) \u4ee5\u524d\u304b\u3089\u975e\u63a8\u5968\u3060\u3063\u305f\u3082\u306e\u304c\u300c\u524a\u9664\u300d\u3078\u9032\u3080<\/h2>\n<h3>Process::Status \u306e\u6f14\u7b97\u5b50\u524a\u9664<\/h3>\n<p>Process::Status#&#038; \u3068 Process::Status#>> \u304c\u524a\u9664\u3055\u308c\u305f\u3002dev.to \u306e NEWS \u8aad\u307f\u89e3\u304d\u8a18\u4e8b\u3067\u306f\u3001\u3053\u308c\u3089\u306f Ruby 3.3 \u3067 deprecated \u306b\u306a\u3063\u3066\u3044\u305f\u3082\u306e\u3067\u3001\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u3092\u8997\u304f\u7528\u9014\u306b\u4f7f\u308f\u308c\u3066\u3044\u305f\u304c\u3001\u5c02\u7528\u30e1\u30bd\u30c3\u30c9\u304c\u3042\u308b\u305f\u3081\u4e0d\u8981\u306b\u306a\u3063\u305f\u3001\u3068\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/dev.to\/ko1\/reading-ruby-40-news-with-pros-3mln\">Reading Ruby 4.0 NEWS with Pros\uff08dev.to\uff09<\/a><\/li>\n<\/ul>\n<h3>ObjectSpace._id2ref \u304c deprecated<\/h3>\n<p>ObjectSpace._id2ref \u306f deprecated \u306b\u306a\u3063\u305f\u3002dev.to \u306e\u8a18\u4e8b\u3067\u306f\u3001object_id \u304b\u3089\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u53d6\u5f97\u3059\u308b\u3053\u306e API \u3092 deprecated \u306b\u3059\u308b\u5224\u65ad\u81ea\u4f53\u306f\u4ee5\u524d\u304b\u3089\u3042\u3063\u305f\u304c\u3001\u3044\u308d\u3044\u308d\u306a\u7d4c\u7def\u3067\u5fd8\u308c\u3089\u308c\u3066\u304a\u308a\u3001\u4eca\u56de\u3064\u3044\u306b deprecated \u306b\u306a\u3063\u305f\u3001\u3068\u3044\u3046\u8aac\u660e\u304c\u3042\u308b\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/dev.to\/ko1\/reading-ruby-40-news-with-pros-3mln\">Reading Ruby 4.0 NEWS with Pros\uff08dev.to\uff09<\/a><\/li>\n<li>\u4e92\u63db\u6027\u30e1\u30e2\uff08deprecated \u660e\u8a18\uff09: <a href=\"https:\/\/fedoraproject.org\/wiki\/Changes\/Ruby_4.0\">Fedora Changes\/Ruby 4.0<\/a><\/li>\n<\/ul>\n<hr>\n<h2>4) \u4f8b\u5916\u30fb\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306e\u898b\u3048\u65b9\u304c\u5909\u308f\u308b\uff08\u30c6\u30b9\u30c8\u306e\u6587\u5b57\u5217\u4e00\u81f4\u306b\u6ce8\u610f\uff09<\/h2>\n<p>\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306e\u8868\u793a\u304c\u5909\u308f\u308b\u3002dev.to \u306e\u8a18\u4e8b\u3067\u306f\u3001wrong number of arguments \u306e ArgumentError \u306b\u304a\u3044\u3066\u3001\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u306b\u30ec\u30b7\u30fc\u30d0\u306e\u30af\u30e9\u30b9\uff0f\u30e2\u30b8\u30e5\u30fc\u30eb\u540d\u304c\u542b\u307e\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u4f8b\uff08Ruby 3.4 \u3068 Ruby 4.0 \u306e\u5dee\u5206\uff09\u304c\u793a\u3055\u308c\u3066\u3044\u308b\u3002\u4f8b\u5916\u30e1\u30c3\u30bb\u30fc\u30b8\u3084\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u6587\u5b57\u5217\u3092\u53b3\u5bc6\u4e00\u81f4\u3067\u691c\u8a3c\u3057\u3066\u3044\u308b\u30c6\u30b9\u30c8\uff08\u30b9\u30ca\u30c3\u30d7\u30b7\u30e7\u30c3\u30c8\u7684\u306a\u904b\u7528\u3092\u542b\u3080\uff09\u306f\u3001\u3053\u3053\u3067\u843d\u3061\u3084\u3059\u3044\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/dev.to\/ko1\/reading-ruby-40-news-with-pros-3mln\">Reading Ruby 4.0 NEWS with Pros\uff08dev.to\uff09<\/a><\/li>\n<\/ul>\n<hr>\n<h2>5) C \u62e1\u5f35\uff08\u30cd\u30a4\u30c6\u30a3\u30d6\u62e1\u5f35\uff09\u3092\u6301\u3064\u5834\u5408\u306e\u6ce8\u610f<\/h2>\n<p>C API \u5074\u3082\u66f4\u65b0\u304c\u3042\u308b\u3002Fedora \u306e\u30e1\u30e2\u3067\u306f\u3001IO \u306b\u95a2\u3057\u3066 rb_thread_fd_close \u304c deprecated \u3067 no-op \u306b\u306a\u3063\u305f\u3053\u3068\u3001\u30d5\u30a1\u30a4\u30eb\u30c7\u30a3\u30b9\u30af\u30ea\u30d7\u30bf\u3092 Ruby \u306b\u516c\u958b\u3059\u308b\u306a\u3089 RUBY_IO_MODE_EXTERNAL \u3092\u4f7f\u3063\u3066 IO \u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u308a\u3001rb_io_close(io) \u3067\u9589\u3058\u308b\u3079\u304d\u3053\u3068\u3001fd \u3092\u76f4\u63a5 close \u3059\u308b\u3068 pending operation \u3092 interrupt \u3067\u304d\u305a undefined behavior \u306b\u7e4b\u304c\u308a\u3046\u308b\u3053\u3068\u304c\u8a18\u8f09\u3055\u308c\u3066\u3044\u308b\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/fedoraproject.org\/wiki\/Changes\/Ruby_4.0\">Fedora Changes\/Ruby 4.0<\/a><\/li>\n<\/ul>\n<hr>\n<h2>6) RubyGems \/ Bundler\uff08\u5468\u8fba\u30c4\u30fc\u30eb\uff09\u306e\u8ffd\u968f<\/h2>\n<p>\u5b9f\u52d9\u4e0a\u3001Ruby \u672c\u4f53\u3088\u308a\u3082 RubyGems \/ Bundler \u306e\u66f4\u65b0\u3067 CI \u3084\u904b\u7528\u306e\u524d\u63d0\u304c\u5d29\u308c\u308b\u3053\u3068\u304c\u3042\u308b\u3002Ruby 4.0 \u3078\u306e\u79fb\u884c\u3067\u306f\u3001\u8a00\u8a9e\u4ed5\u69d8\u306e\u5dee\u5206\u3060\u3051\u3067\u306a\u304f\u3001gem \u306e\u89e3\u6c7a\u30fb\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u30fb\u30d3\u30eb\u30c9\u306e\u6d41\u308c\u3092\u542b\u3081\u305f\u624b\u9806\u5168\u4f53\u3092 Ruby 4.0 \u74b0\u5883\u3067\u901a\u3059\u5fc5\u8981\u304c\u3042\u308b\u3002\u7279\u306b\u3001RubyGems \/ Bundler \u306e breaking changes \u306b\u3088\u308a\u3001\u53e4\u3044\u30b3\u30de\u30f3\u30c9\uff0f\u30aa\u30d7\u30b7\u30e7\u30f3\u3084\u524d\u63d0\u304c\u524a\u9664\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u304c\u3042\u308b\u3002<\/p>\n<ul>\n<li>\u516c\u5f0f NEWS\uff08\u5168\u4f53\u50cf\u306e\u4e00\u6b21\u60c5\u5831\u8d77\u70b9\uff09: <a href=\"https:\/\/docs.ruby-lang.org\/en\/master\/NEWS_md.html\">NEWS for Ruby 4.0.0<\/a><\/li>\n<\/ul>\n<hr>\n<h2>\u79fb\u884c\u306e\u5b9f\u52d9\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8\uff08\u77ed\u7e2e\u7248\uff09<\/h2>\n<p>\u672c\u7a3f\u306e\u5185\u5bb9\u3092\u305d\u306e\u307e\u307e\u4f5c\u696d\u306b\u843d\u3068\u3059\u305f\u3081\u306e\u6700\u4f4e\u9650\u306e\u30c1\u30a7\u30c3\u30af\u30ea\u30b9\u30c8\u3092\u307e\u3068\u3081\u308b\u3002<\/p>\n<ol>\n<li>require &#8216;cgi&#8217; \u3084 CGI. \u3092\u691c\u7d22\u3057\u3001\u30d5\u30eb\u6a5f\u80fd\u304c\u5fc5\u8981\u306a\u3089 Gem \u4f9d\u5b58\u3068\u3057\u3066 gem &#8216;cgi&#8217; \u3092\u660e\u793a\u3059\u308b\u3002escape \u7cfb\u306e\u307f\u306a\u3089 require &#8216;cgi\/escape&#8217; \u3078\u5bc4\u305b\u308b\u3002\u53c2\u7167: Fedora \/ Zenn\u3002<\/li>\n<li>SortedSet \u3092\u691c\u7d22\u3057\u3001\u5fc5\u8981\u306a\u3089 sorted_set gem \u3092\u8ffd\u52a0\u3057\u3066 require &#8216;sorted_set&#8217; \u306b\u5207\u308a\u66ff\u3048\u308b\u3002\u53c2\u7167: Fedora\u3002<\/li>\n<li>Ractor.yield \/ Ractor#take \/ Ractor#close_incoming \/ Ractor#close_outgoing \u3092\u691c\u7d22\u3057\u3001Ractor::Port \u524d\u63d0\u306e\u8a2d\u8a08\u3078\u79fb\u884c\u3059\u308b\u3002\u53c2\u7167: Fedora\u3002<\/li>\n<li>Process::Status#&#038; \/ #>> \u3092\u691c\u7d22\u3057\u3001exitstatus\/success? \u7b49\u306e\u5c02\u7528 API \u306b\u5bc4\u305b\u308b\u3002\u53c2\u7167: dev.to\u3002<\/li>\n<li>ObjectSpace._id2ref \u306b\u4f9d\u5b58\u3057\u3066\u3044\u308b\u7b87\u6240\u304c\u306a\u3044\u304b\u78ba\u8a8d\u3057\u3001\u8a2d\u8a08\u3092\u898b\u76f4\u3059\uff08deprecated\uff09\u3002\u53c2\u7167: dev.to \/ Fedora\u3002<\/li>\n<li>\u4f8b\u5916\u30e1\u30c3\u30bb\u30fc\u30b8\uff0f\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u6587\u5b57\u5217\u3067\u53b3\u5bc6\u4e00\u81f4\u3057\u3066\u3044\u308b\u30c6\u30b9\u30c8\u304c\u3042\u308c\u3070\u3001Ruby 4.0 \u306e\u8868\u793a\u5909\u66f4\u3067\u843d\u3061\u308b\u53ef\u80fd\u6027\u3092\u524d\u63d0\u306b\u898b\u76f4\u3059\u3002\u53c2\u7167: dev.to\u3002<\/li>\n<li>C \u62e1\u5f35\uff08\u30cd\u30a4\u30c6\u30a3\u30d6\u62e1\u5f35\uff09\u3092\u4f7f\u3046 gem\uff0f\u81ea\u524d\u62e1\u5f35\u304c\u3042\u308b\u5834\u5408\u306f\u3001Ruby 4.0 \u3067 bundle install \u304b\u3089\u30c6\u30b9\u30c8\u307e\u3067\u901a\u3057\u3001rb_thread_fd_close \u306e no-op \u5316\u306a\u3069\u306e\u5f71\u97ff\u304c\u306a\u3044\u304b\u78ba\u8a8d\u3059\u308b\u3002\u53c2\u7167: Fedora\u3002<\/li>\n<\/ol>\n<hr>\n<h2>\u4ed8\u9332: \u30b3\u30fc\u30c9\u65ad\u7247\uff08\u5fc5\u8981\u6700\u5c0f\u9650\uff09<\/h2>\n<p>\u672c\u7a3f\u3067\u306f\u30d6\u30ed\u30b0\u672c\u6587\u306e\u53ef\u8aad\u6027\u3092\u512a\u5148\u3057\u3001\u30b3\u30fc\u30c9\u65ad\u7247\u306f\u5fc5\u8981\u6700\u5c0f\u9650\u306b\u7559\u3081\u308b\u3002<\/p>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:1000px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/>4<br \/>5<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\"># Ruby 4.0: \u884c\u982d\u8ad6\u7406\u6f14\u7b97\u5b50\uff08&amp;&amp; \u306a\u3069\uff09\u304c\u524d\u884c\u306e\u7d99\u7d9a\u3068\u3057\u3066\u6271\u308f\u308c\u308b<br \/>\nif condition1<br \/>\n&nbsp; &amp;&amp; condition2<br \/>\n&nbsp; &nbsp; do_something<br \/>\nend<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<div class=\"codecolorer-container text geshi\" style=\"overflow:auto;white-space:nowrap;width:1000px;\"><table cellspacing=\"0\" cellpadding=\"0\"><tbody><tr><td class=\"line-numbers\"><div>1<br \/>2<br \/>3<br \/><\/div><\/td><td><div class=\"text codecolorer\" style=\"white-space:nowrap\"># CGI: escape \u7cfb\u3060\u3051\u3092\u4f7f\u3046\u306a\u3089 require &quot;cgi\/escape&quot;<br \/>\n# \u30d5\u30eb\u6a5f\u80fd\u3092\u4f7f\u3046\u306a\u3089 gem &quot;cgi&quot; \u3092\u660e\u793a\u3057\u3066 require &quot;cgi&quot;<br \/>\nrequire &quot;cgi\/escape&quot;<\/div><\/td><\/tr><\/tbody><\/table><\/div>\n<hr>\n<h2>\u7d50\u3073<\/h2>\n<p>Ruby 4.0 \u306f \u201cRuby Box\u201d \u3068 \u201cZJIT\u201d \u306e\u5c0e\u5165\u3092\u63b2\u3052\u3064\u3064\u3001\u65e2\u5b58\u30b3\u30fc\u30c9\u5074\u306b\u306f stdlib\/default gems \u306e\u6574\u7406\uff08CGI\u3001SortedSet \u306a\u3069\uff09\u3084\u3001\u4e26\u5217\u6a5f\u69cb\uff08Ractor\uff09\u306e API \u518d\u8a2d\u8a08\u3001deprecated \u3060\u3063\u305f API \u306e\u6574\u7406\u3001\u30d0\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u8868\u793a\u306e\u5909\u66f4\u3001C API \u306e\u6ce8\u610f\u70b9\u306a\u3069\u3001\u4fdd\u5b88\u89b3\u70b9\u3067\u7121\u8996\u3067\u304d\u306a\u3044\u4e92\u63db\u6027\u306e\u5dee\u5206\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3002\u79fb\u884c\u6642\u306f\u300c\u65b0\u6a5f\u80fd\u3092\u4f7f\u3046\u304b\u300d\u3088\u308a\u5148\u306b\u3001\u300c\u65e2\u5b58\u30b3\u30fc\u30c9\u304c\u6697\u9ed9\u306b\u4f9d\u5b58\u3057\u3066\u3044\u305f\u524d\u63d0\u304c\u6b8b\u3063\u3066\u3044\u308b\u304b\u300d\u3092\u6d17\u3044\u51fa\u3059\u3053\u3068\u304c\u91cd\u8981\u306b\u306a\u308b\u3002<\/p>\n<p>\u6700\u7d42\u7684\u306b\u306f\u3001Ruby 4.0 \u74b0\u5883\u3067 bundle install \u304b\u3089\u30c6\u30b9\u30c8\u5b8c\u8d70\u307e\u3067\u3092\u78ba\u5b9f\u306b\u901a\u3057\u3001\u554f\u984c\u304c\u51fa\u305f\u7b87\u6240\u3092\u300cstdlib\/default gems\u300d\u300cRactor\u300d\u300cdeprecated\u2192\u524a\u9664\u300d\u300c\u8868\u793a\u5909\u66f4\u300d\u300cC API\u300d\u300c\u5468\u8fba\u30c4\u30fc\u30eb\u300d\u306e\u3069\u3053\u306b\u5c5e\u3059\u308b\u304b\u3067\u5207\u308a\u5206\u3051\u308b\u306e\u304c\u3001\u6700\u3082\u77ed\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6628\u65e5 Ruby 4.0 \u304c\u30ea\u30ea\u30fc\u30b9\u3055\u308c\u305f\u3002\u6700\u8fd1\u306f\u3082\u3063\u3071\u3089 Python \u3070\u304b\u308a\u4f7f\u3063\u3066\u3044\u308b\u304c\u3001\u304b\u3064\u3066\u306f Ruby \u3092\u3088\u304f\u4f7f\u3063\u3066\u3044\u305f\u3053\u3068\u3082\u3042\u308a\u3001\u65b0\u6a5f\u80fd\u53ca\u3073\u3001\u4eca\u5f8c\u306e Ruby \u30b9\u30af\u30ea\u30d7\u30c8\u4fdd\u5b88\u306e\u305f\u3081\u4e92\u63db\u6027\u7dad\u6301\u306e\u305f\u3081\u306b\u6c17\u3092\u3064\u3051\u306a\u3051 &#8230; <a title=\"Ruby 4.0 \u65b0\u6a5f\u80fd\u3068 Ruby 3.x \u7cfb\u30b3\u30fc\u30c9\u306e\u4e92\u63db\u6027\u7dad\u6301\u3067\u6ce8\u610f\u3059\u3079\u304d\u70b9\" class=\"read-more\" href=\"https:\/\/blog.id774.net\/entry\/2025\/12\/26\/3138\/\" aria-label=\"Ruby 4.0 \u65b0\u6a5f\u80fd\u3068 Ruby 3.x \u7cfb\u30b3\u30fc\u30c9\u306e\u4e92\u63db\u6027\u7dad\u6301\u3067\u6ce8\u610f\u3059\u3079\u304d\u70b9 \u306b\u3064\u3044\u3066\u3055\u3089\u306b\u8aad\u3080\">\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-3138","post","type-post","status-publish","format-standard","hentry","category-tech"],"_links":{"self":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts\/3138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/comments?post=3138"}],"version-history":[{"count":3,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts\/3138\/revisions"}],"predecessor-version":[{"id":3141,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/posts\/3138\/revisions\/3141"}],"wp:attachment":[{"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/media?parent=3138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/categories?post=3138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.id774.net\/entry\/wp-json\/wp\/v2\/tags?post=3138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}