# \[Ruby 1.8 - Bug #269\] (Open) OptionParser#environment requires shellwords

**URL:** <https://www.ruby-forum.com/t/ruby-1-8-bug-269-open-optionparser-environment-requires-shellwords/142923>\
**Category:** Development\
**Created:** [July 13, 2008, 3:56pm UTC](https://www.ruby-forum.com/t/ruby-1-8-bug-269-open-optionparser-environment-requires-shellwords/142923 "2008-07-13T15:56:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Takashi\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/4af34b/32.png) [@Takashi\_T](https://www.ruby-forum.com/u/Takashi_T)\
**Post date:** [July 13, 2008, 3:56pm UTC](https://www.ruby-forum.com/t/ruby-1-8-bug-269-open-optionparser-environment-requires-shellwords/142923/1 "2008-07-13T15:56:25Z")

</div>

e$B%A%1%C%He(B #269 e$B$,Js9p$5$l$^$7$?!#e(B (by Takashi T.)

* * *

Bug #269: OptionParser#environment requires shellwords  
[http://redmine.ruby-lang.org/issues/show/269](http://redmine.ruby-lang.org/issues/show/269)

e$B5/I\<\<Te(B: Takashi T.  
e$B%9%F!\<%?%9e(B: Open  
e$BM%@hEYe(B: Normal  
e$BC4Ev\<Te(B:  
e$B%+%F%4%je(B:  
Target version:

OptionParser#environment e$B$,e(B shellwords e$B%i%$%V%i%j$Ne(B  
Shellwords.shellwords e$B$re(B  
e$B;H$C$F$$$^$9$,!"e(Boptparse.rb e$B\<+BN$Oe(B shellwords e$B$re(B  
require e$B$7$F$$$^$;$s!#e(B  
e$B$N$Ge(B OptionParser#environment e$B$r;H$&$H\>o$KNc30$,H/@8$7$^$9!#e(B

$ cat t.rb  
require ‘optparse’  
ENV[“A”] = ‘-a -b’  
p OptionParser.new.environment(“A”)

$ ruby-1.8 -v t.rb  
ruby 1.8.7 (2008-07-01 revision 17756) [i686-linux]  
/usr/local/lib/ruby/1.8/optparse.rb:1479:in `environment’:  
uninitialized constant OptionParser::Shellwords (NameError)  
from t.rb:3

---

<div class="post-metadata">

**Author:** ![Takashi\_T](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/4af34b/32.png) [@Takashi\_T](https://www.ruby-forum.com/u/Takashi_T)\
**Post date:** [July 13, 2008, 11:07pm UTC](https://www.ruby-forum.com/t/ruby-1-8-bug-269-open-optionparser-environment-requires-shellwords/142923/2 "2008-07-13T23:07:41Z")

</div>

e$B%A%1%C%He(B #269 e$B$,99?7$5$l$^$7$?!#e(B (by Nobuyoshi N.)

e$B%9%F!\<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B  
e$B?JD=e(B % 0e$B$+$ie(B100e$B$KJQ99e(B

## Applied in changeset r18058.

[http://redmine.ruby-lang.org/issues/show/269](http://redmine.ruby-lang.org/issues/show/269)
