title: Ruby script/console and Ruby script/server using two different DBs?
body: <p>Has anyone seen where script/console and script/server load two different databases (though both report using the same)? Here's the first output</p>
  
  <pre><code>$ script/server
  =&gt; Booting WEBrick
  =&gt; Rails 2.3.5 application starting on http://0.0.0.0:3000
  =&gt; Call with -d to detach
  =&gt; Ctrl-C to shutdown server
  [2010-03-21 15:54:05] INFO  WEBrick 1.3.1
  [2010-03-21 15:54:05] INFO  ruby 1.8.7 (2010-01-10) [i386-mingw32]
  [2010-03-21 15:54:05] INFO  WEBrick::HTTPServer#start: pid=7148 port=3000
  </code></pre>
  
  <p>No errors. I then run my standard code for entering a form - no problems.</p>
  
  <p>Checking the Dev Database (.yml at bottom):</p>
  
  <pre><code>mysql&gt; select * from books;
  [...]
  | 712 | Book | Book Name | 2010-03-21 22:29:22 | 2010-03-21 22:29:22 |
  [...]
  712 rows in set (0.00 sec)
  </code></pre>
  
  <p>The code CLEARLY saved it seconds ago</p>
  
  <p>And now here's the output of script/console:</p>
  
  <pre><code>$ script/console
  Loading development environment (Rails 2.3.5)
  &gt;&gt; Book.all
  =&gt; []
  </code></pre>
  
  <p>Nothing. Further, upon further inspection, it's using the production database, but I can't figure out why. Any thoughts here? All consoles have been closed and reopened.</p>
  
  <p><strong>UPDATE:</strong> Requested .yml file (can't see how it'd be helpful (user name and password are all the same for each)) - </p>
  
  <pre><code>development:
    adapter: mysql  
    database: BooksDBdev
    username: &lt;user name&gt;
    password: &lt;long string&gt;
    timeout: 5000
  
  # Warning: The database defined as "test" will be erased and
  # re-generated from your development database when you run "rake".
  # Do not set this db to the same as development or production.
  test:
    adapter: mysql
    database: BooksDBtest
    username: &lt;user name&gt;
    password: &lt;long string&gt;
    timeout: 5000
  
  production:
    adapter: mysql
    database: BooksDB
    username: &lt;user name&gt;
    password: &lt;long string&gt;
    timeout: 5000
  </code></pre>
  
  <p><strong>Updated 2</strong>: Here's the output when I force the console environment.</p>
  
  <pre><code>$ script/console development
  Loading development environment (Rails 2.3.5)
  &gt;&gt; Book.all
  =&gt; []
  &gt;&gt; exit
  
  $ ruby script/console development
  Loading development environment (Rails 2.3.5)
  &gt;&gt; Book.all
  =&gt; []
  </code></pre>
  
  <p>Just FYI, I don't have RAILS_ENV specified in my environment variables.</p>