title: Frozen string - Ruby
body: <p>I have this code:</p>
  
  <pre><code> settings[:base_name].gsub! /[\x00\/\\:\*\?\"&lt;&gt;\|]/, ''
  </code></pre>
  
  <p>When I run the script it throws an error:</p>
  
  <pre><code>gsub!': can't modify frozen String (RuntimeError)
  </code></pre>
  
  <p>I have changed the code to this:</p>
  
  <pre><code> settings[:base_name] = settings[:base_name].gsub /[\x00\/\\:\*\?\"&lt;&gt;\|]/, ''
  </code></pre>
  
  <p>The code above works, but I don't like at all, is there a way to properly use gsub! in this case?</p>