Bug #6121


[[Ruby 1.9:]] Etc.sysconfdir hides sysconfdir on windows

Added by mpapis (Michal Papis) over 10 years ago. Updated over 4 years ago.

Target version:
ruby -v:
ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux]


While checking on this issue I found out that Etc.sysconfdir is inconsistently behaving between Linux and Windows.

This issue is related to rubygems also:

On linux you can change sysconfdir with:
and the calculated path will be available for rubygems and via Etc.sysconfdir

But on Windows users have no option to force a sysconfdir, they will always use default location (~ C:\Documents and Settings\All Users\Application Data).

Also this is not consistent to the documentation header for this function.

Is this intended behavior ?

I could see few occasions where it should be supported to allow switching to system location even --prefix / --sysconfdir was used, but this should be rather configurable not a forced setting.

Even if this is not being implemented/fixed could I get a statement if it is good for rubygems to follow Etc.sysconfdir behavior or it should rather using RbConfig::CONFIG['sysconfdir'] ?

Updated by naruse (Yui NARUSE) over 10 years ago

  • Status changed from Open to Assigned
  • Assignee set to usa (Usaku NAKAMURA)

Updated by usa (Usaku NAKAMURA) over 9 years ago

  • Category set to build
  • Priority changed from 3 to Normal
  • Target version set to 2.0.0

Updated by mame (Yusuke Endoh) over 9 years ago

  • Target version changed from 2.0.0 to 2.6

Postponing it to next minor.
Usa-san, let me know if you think it is a significant issue.

Yusuke Endoh

Updated by usa (Usaku NAKAMURA) over 4 years ago

  • Assignee changed from usa (Usaku NAKAMURA) to nobu (Nobuyoshi Nakada)
Actions #5

Updated by nobu (Nobuyoshi Nakada) over 4 years ago

  • Status changed from Assigned to Closed

Applied in changeset trunk|r60279.

sysconfdir on Windows

  • ext/etc/etc.c (etc_sysconfdir): mentioned special case on
    Windows. [ruby-core:43110] [Bug #6121]

  • win32/Makefile.sub (config.status): sysconfdir is not used on


Also available in: Atom PDF