Project

General

Profile

Actions

Bug #13744

closed

Spawn doesn't work with options of symbol keys generated dynamically

Added by satoryu (Tatsuya Sato) almost 7 years ago. Updated over 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.5.0dev (2017-07-13 trunk 59321) [x86_64-darwin16]
[ruby-core:82033]

Description

spawn works when giving options whose key is symbol literal:

$ ruby -e 'spawn("ls", :rlimit_cpu => 100)'

But spawn fails when generating symbol from a String:

$ ruby -e 'spawn("ls", "rlimit_cpu".to_sym => 100)'
-e:1:in `spawn': wrong exec option symbol: rlimit_cpu (ArgumentError)
        from -e:1:in `<main>'
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0Like0