title: Sitemap generator couldn't find table - StatementInvalid
body: <p>I'm using sitemap generator to generate my sitemap.
  I've tested all my code locally and I was ready to try it on the online webserver and the following happend when I tried to refresh the Sitemap <code>bundle exec rake sitemap:refresh</code>:</p>
  
  <pre><code>ActiveRecord::StatementInvalid: Could not find table 'settings'
  </code></pre>
  
  <p><strong>Code executed in sitemap.rb:</strong></p>
  
  <pre><code>SitemapGenerator::Sitemap.create do
        settings = Settings.first
        languages = []
        languages &lt;&lt; "en" if settings.lang_en
        languages &lt;&lt; "fr" if settings.lang_fr
        languages &lt;&lt; "nl" if settings.lang_nl
        languages &lt;&lt; "de" if settings.lang_de
  end
  </code></pre>
  
  <p><strong>Result of same code in console on the webserver:</strong></p>
  
  <pre><code>[1] pry(main)&gt; settings = Settings.first
    Settings Load (2.0ms)  SELECT "settings".* FROM "settings" LIMIT 1
    Settings::Translation Load (2.0ms)  SELECT "setting_translations".* FROM "setting_translations" WHERE "setting_translations"."setting_id" = 1
  
    #Output here
  
  [2] pry(main)&gt; languages = []
  =&gt; []
  [3] pry(main)&gt; languages &lt;&lt; "en" if settings.lang_en
  =&gt; nil
  [4] pry(main)&gt; languages &lt;&lt; "fr" if settings.lang_fr
  =&gt; ["fr"]
  [5] pry(main)&gt; languages &lt;&lt; "nl" if settings.lang_nl
  =&gt; ["fr", "nl"]
  [6] pry(main)&gt; languages &lt;&lt; "de" if settings.lang_de
  =&gt; nil
  [7] pry(main)&gt; languages
  =&gt; ["fr", "nl"]
  </code></pre>
  
  <p><strong>Full error:</strong></p>
  
  <pre><code>rake aborted!
  ActiveRecord::StatementInvalid: Could not find table 'settings'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/connection_adapters/sqlite_adapter.rb:472:in `table_structure'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/connection_adapters/sqlite_adapter.rb:346:in `columns'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/connection_adapters/schema_cache.rb:12:in `block in initialize'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/model_schema.rb:229:in `yield'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/model_schema.rb:229:in `default'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/model_schema.rb:229:in `columns'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/model_schema.rb:238:in `columns_hash'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/locking/optimistic.rb:131:in `locking_enabled?'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/relation.rb:170:in `exec_queries'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/relation.rb:160:in `block in to_a'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/explain.rb:34:in `logging_query_plan'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/relation.rb:159:in `to_a'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/relation/finder_methods.rb:381:in `find_first'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/relation/finder_methods.rb:122:in `first'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/active_record/querying.rb:5:in `first'
  /home/&lt;customer_here&gt;/apps/default/releases/324/config/sitemap.rb:8:in `block in run'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/sitemap_generator-5.0.5/lib/sitemap_generator/interpreter.rb:59:in `instance_eval'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/sitemap_generator-5.0.5/lib/sitemap_generator/interpreter.rb:59:in `eval'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/sitemap_generator-5.0.5/lib/sitemap_generator/link_set.rb:40:in `create'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/sitemap_generator-5.0.5/lib/sitemap_generator.rb:42:in `method_missing'
  /home/&lt;customer_here&gt;/apps/default/releases/324/config/sitemap.rb:5:in `run'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/sitemap_generator-5.0.5/lib/sitemap_generator/interpreter.rb:76:in `instance_eval'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/sitemap_generator-5.0.5/lib/sitemap_generator/interpreter.rb:76:in `run'
  /home/&lt;customer_here&gt;/apps/default/releases/324/vendor/bundle/ruby/1.9.1/gems/sitemap_generator-5.0.5/lib/sitemap_generator/tasks.rb:51:in `block (2 levels) in &lt;top (required)&gt;'
  Tasks: TOP =&gt; sitemap:refresh =&gt; sitemap:create
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>Gem Used: <a href="https://github.com/kjvarga/sitemap_generator" rel="nofollow">https://github.com/kjvarga/sitemap_generator</a></p>
  
  <p>OS: Mac OS X 10.9.4</p>
  
  <p>Rails Version: Rails 3.2.18</p>
  
  <p>Ruby Version: ruby 1.9.3p484</p>
  
  <p>Kind regards.</p>
  
  <p><strong>EDIT1: tried to change the variable settings - same error</strong></p>
  
  <pre><code>  langu_settings = Settings.first
    languages = []
    languages &lt;&lt; "en" if langu_settings.lang_en
    languages &lt;&lt; "fr" if langu_settings.lang_fr
    languages &lt;&lt; "nl" if langu_settings.lang_nl
    languages &lt;&lt; "de" if langu_settings.lang_de
  </code></pre>