From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: poffice@blade.nagaokaut.ac.jp Delivered-To: poffice@blade.nagaokaut.ac.jp Received: from kankan.nagaokaut.ac.jp (smtp.nagaokaut.ac.jp [133.44.2.24]) by blade.nagaokaut.ac.jp (Postfix) with ESMTP id 38E2B1BA013A for ; Thu, 18 May 2017 22:10:41 +0900 (JST) Received: from voscc.nagaokaut.ac.jp (voscc.nagaokaut.ac.jp [133.44.1.100]) by kankan.nagaokaut.ac.jp (Postfix) with ESMTP id 19FEEB5D87C for ; Thu, 18 May 2017 22:56:04 +0900 (JST) Received: from neon.ruby-lang.org (neon.ruby-lang.org [221.186.184.75]) by voscc.nagaokaut.ac.jp (Postfix) with ESMTP id BFB4D18CC80A for ; Thu, 18 May 2017 22:56:04 +0900 (JST) Received: from neon.ruby-lang.org (localhost [IPv6:::1]) by neon.ruby-lang.org (Postfix) with ESMTP id 92B0A120751; Thu, 18 May 2017 22:56:02 +0900 (JST) X-Original-To: ruby-core@ruby-lang.org Delivered-To: ruby-core@ruby-lang.org Received: from o1678916x28.outbound-mail.sendgrid.net (o1678916x28.outbound-mail.sendgrid.net [167.89.16.28]) by neon.ruby-lang.org (Postfix) with ESMTPS id 4435A1205E0 for ; Thu, 18 May 2017 22:55:57 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=sendgrid.me; h=from:to:references:subject:mime-version:content-type:content-transfer-encoding:list-id; s=smtpapi; bh=IsJ1R/DKAV1oiTvzxNSu1LLW82A=; b=KpOwpfB4Mxj//5e4WE hcCGEG+SXErsk1ofOoXTPwHAo01jLwrUeTZAi6m9tNra7VafhwV9+LqUZ2MKLQvl D4Bi1lft0nEedk23tZMoGX3QKZjfchNb3iOyh0j9JOvNSxJtRGLerHpb61Gjk0t5 0yE820srlaYLTOytGYXeeolFU= Received: by filter0947p1mdw1.sendgrid.net with SMTP id filter0947p1mdw1-20658-591DA7EA-2 2017-05-18 13:55:54.040654604 +0000 UTC Received: from herokuapp.com (ec2-54-167-11-198.compute-1.amazonaws.com [54.167.11.198]) by ismtpd0003p1iad1.sendgrid.net (SG) with ESMTP id UK7GkH5yTaSj8GJS9VxhxA Thu, 18 May 2017 13:55:54.035 +0000 (UTC) Date: Thu, 18 May 2017 13:55:53 +0000 From: lemsx1@gmail.com To: ruby-core@ruby-lang.org Message-ID: References: Mime-Version: 1.0 X-Redmine-MailingListIntegration-Message-Ids: 56246 X-Redmine-Project: ruby-trunk X-Redmine-Issue-Id: 13040 X-Redmine-Issue-Author: lemsx1 X-Redmine-Sender: lemsx1 X-Mailer: Redmine X-Redmine-Host: bugs.ruby-lang.org X-Redmine-Site: Ruby Issue Tracking System X-Auto-Response-Suppress: All Auto-Submitted: auto-generated X-SG-EID: ync6xU2WACa70kv/Ymy4QrNMhiuLXJG8OTL2vJD1yS7YdARLATGy6Z6EQrG8KslyoLpt5pm65m2Rsw 2daA+9tBXh1Da7gMRFaa5WUu+OMLruZneC7N45kl/kGqj5meRjisBOnJctD+KPy625IhkGkuC3ycQw 34/dqgzic+NGbYkjupDIAFo8Ay3pKvVjF21y X-ML-Name: ruby-core X-Mail-Count: 81224 Subject: [ruby-core:81224] [Ruby trunk Bug#13040] syslog/logger uses "require 'logger'" which is interpreted as circular dependency X-BeenThere: ruby-core@ruby-lang.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: Ruby developers List-Id: Ruby developers List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ruby-core-bounces@ruby-lang.org Sender: "ruby-core" Issue #13040 has been updated by lemsx1 (Luis Mondesi). Am I the only person having this problem? This is in different code sources we are maintaining. Here is the latest. In a new project I setup test with minitest/spec 1. added pp $LOAD_PATH to my test_helper.rb 2. rake test $> rake test ["/Users/lmondesi/Projects/new_project/lib", "/Users/lmondesi/Projects/new_project/lib/new_project", "/usr/local/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib", "/usr/local/lib/ruby/gems/2.4.0/gems/did_you_mean-1.1.0/lib", "/usr/local/lib/ruby/gems/2.4.0/gems/minitest-5.10.1/lib", "/usr/local/lib/ruby/site_ruby/2.4.0", "/usr/local/lib/ruby/site_ruby/2.4.0/x86_64-darwin16", "/usr/local/lib/ruby/site_ruby", "/usr/local/lib/ruby/vendor_ruby/2.4.0", "/usr/local/lib/ruby/vendor_ruby/2.4.0/x86_64-darwin16", "/usr/local/lib/ruby/vendor_ruby", "/usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0", "/usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/x86_64-darwin16"] /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/syslog/logger.rb:81:in `': uninitialized constant Logger (NameError) from /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/syslog/logger.rb:48:in `' from /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' from /usr/local/Cellar/ruby/2.4.1_1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' ---------------------------------------- Bug #13040: syslog/logger uses "require 'logger'" which is interpreted as circular dependency https://bugs.ruby-lang.org/issues/13040#change-64878 * Author: lemsx1 (Luis Mondesi) * Status: Feedback * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux] * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- while using the 'syslog/logger' require from Ruby it works well, however if one tries to use it via "test" it complaints about circular require and the constant "Logger" not defined. After a little digging, I realized that 'syslog/logger' has a line that says require 'logger' which could mean itself! The fix is to use require_relative '../logger' as this is what it intends in order to piggy back on Logger: Current code for syslog/logger: 1. # frozen_string_literal: false 2. require 'syslog' 3. require 'logger' Fixed code: 1. # frozen_string_literal: false 2. require 'syslog' 3. require_relative '../logger' -- https://bugs.ruby-lang.org/