title: Cannot seed database; not working because of refused connection?
body: <p>When I try to seed my application I get the error:</p>
  
  <blockquote>
    <p>No connection could be made because the - target machine actively refused it. - connect(2)</p>
  </blockquote>
  
  <p>I believe the reason why is because I was having issues with mysql2 so I uninstalled it along with the MySQL 5.5 Servers and then switched to sqlite3. I think the server for mysql2 is running in the background so this could be the issue. How would I fix this? How would I turn off the Mysql2 local host server or whichever server it is that's causing this issue?</p>
  
  <p>I am running on Windows 7 64-bit.</p>
  
  <pre><code>Rails 3.0.9
  SQLite3 1.3.4
  </code></pre>
  
  <p>Thanks.</p>
  
  <p>Note: I can migrate and drop fine.</p>
  
  <p>Edit:</p>
  
  <p>config/database.yml</p>
  
  <pre><code># SQLite version 3.x
  #   gem install sqlite3
  development:
    adapter: sqlite3
    database: db/development.sqlite3
    pool: 5
    timeout: 5000
  
  test:
    adapter: sqlite3
    database: db/test.sqlite3
    pool: 5
    timeout: 5000
  
  production:
    adapter: sqlite3
    database: db/production.sqlite3
    pool: 5
    timeout: 5000
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>I tried restarting the PC and also remade my application from scratch, still get the error. Disabled Windows Firewall/Comodo Firewall and tried again, still failure. I did a System Restore but this did not work either.</p>
  
  <p>Here's the full <code>rake db:seed</code>: <a href="https://gist.github.com/1375566" rel="nofollow">https://gist.github.com/1375566</a></p>
  
  <hr>
  
  <p><strong>SOLVED:</strong></p>
  
  <p>I have another application I ran <code>rake db:seed</code> in and it worked correctly, so as the accepted answer by clyfe pointed out, Sunspot was the issue. I put together again my application and stopped at adding sunspot and suddenly I got the error:</p>
  
  <pre><code>rake db:seed
  (in C:/testagain)
  Deleting database now...
  rake aborted!
  undefined method `searchable' for #&lt;Class:0x52cdca0&gt;
  </code></pre>
  
  <p>Which means the rake was reading my code inside of my UserPrice model that dealt with Sunspot:</p>
  
  <pre><code>class UserPrice &lt; ActiveRecord::Base
    # Sunspot and Websolr configuration.
    #searchable do
     # text :product_name do
     #   product.name
     # end
   # end
  end
  </code></pre>
  
  <p>I commented this out and was able to seed correctly. Then I went on to try sunspot using these commands in the following order:</p>
  
  <pre><code>rails g sunspot_rails:install
  rake sunspot:solr:start (also un-comment model)
  rake sunspot:reindex
  rails server
  rake db:seed
  </code></pre>
  
  <p>Everything works as it should.</p>