title: Why do I get errors running shell commands in rails console (irb)
body: <p>When I run a simple <code>ls</code> command from the Rails console, I'm getting this error:</p>
  
  <pre><code>$ rails c
  irb(main):001:0&gt; `ls`
  script/rails: No such file or directory - ls
  =&gt; nil
  </code></pre>
  
  <p>I have the same error when using other commands such as <code>cd ~</code>. Can anyone tell me why the contents of the current folder are not displayed? </p>
  
  <p><strong>UPDATE:</strong>
  After trying <code>exec('ls')</code>, this is the output, which is making me think it must be some local setting.</p>
  
  <pre><code>irb(main):001:0&gt; exec('ls')
  Errno::ENOENT: No such file or directory - ls
      from (irb):1:in `exec'
      from (irb):1
      from     /[filepath]/runtime/ruby1.9/gems/1.9.1/gems/railties-3.2.18/lib/rails/commands/console.rb:47:in `start'
  from /[filepath]/runtime/ruby1.9/gems/1.9.1/gems/railties-3.2.18/lib/rails/commands/console.rb:8:in `start'
  from /[filepath]/runtime/ruby1.9/gems/1.9.1/gems/railties-3.2.18/lib/rails/commands.rb:41:in `&lt;top (required)&gt;'
  from /[filepath]/runtime/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in `require'
  from /[filepath]/runtime/ruby1.9/1.9.1/rubygems/custom_require.rb:36:in `require'
  from script/rails:6:in `&lt;main&gt;'
  </code></pre>