【问题标题】:Heroku complaining about sqlite3 after I already uninstalled itHeroku 在我卸载 sqlite3 后抱怨它
【发布时间】:2013-08-01 22:12:35
【问题描述】:

我正在尝试推送到 heroku,但我最初收到如下错误消息:

Detected sqlite3 gem which is not supported on Heroku.
 !     https://devcenter.heroku.com/articles/sqlite3

所以我用heroku替换了sqlite3,现在它仍然报同样的错误信息

谁能帮帮我

这是我的 gemfile 和 gemfile.lock

source 'https://rubygems.org'

gem 'rails', '3.2.13'
gem 'pg'
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
gem 'backbone-on-rails'

gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.13)
      actionpack (= 3.2.13)
      mail (~> 2.5.3)
    actionpack (3.2.13)
      activemodel (= 3.2.13)
      activesupport (= 3.2.13)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.5)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.2.1)
    activemodel (3.2.13)
      activesupport (= 3.2.13)
      builder (~> 3.0.0)
    activerecord (3.2.13)
      activemodel (= 3.2.13)
      activesupport (= 3.2.13)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.13)
      activemodel (= 3.2.13)
      activesupport (= 3.2.13)
    activesupport (3.2.13)
      i18n (= 0.6.1)
      multi_json (~> 1.0)
    arel (3.0.2)
    backbone-on-rails (1.0.0.0)
      eco
      ejs
      jquery-rails
      rails (>= 3.1)
    builder (3.0.4)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.2.0)
      coffee-script-source
      execjs
    coffee-script-source (1.6.3)
    eco (1.0.0)
      coffee-script
      eco-source
      execjs
    eco-source (1.1.0.rc.1)
    ejs (1.1.1)
    erubis (2.7.0)
    execjs (1.4.0)
      multi_json (~> 1.0)
    hike (1.2.3)
    i18n (0.6.1)
    journey (1.0.4)
    jquery-rails (3.0.4)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    json (1.8.0)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.23)
    multi_json (1.7.7)
    pg (0.16.0)
    polyglot (0.3.3)
    rack (1.4.5)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-ssl (1.3.3)
      rack
    rack-test (0.6.2)
      rack (>= 1.0)
    rails (3.2.13)
      actionmailer (= 3.2.13)
      actionpack (= 3.2.13)
      activerecord (= 3.2.13)
      activeresource (= 3.2.13)
      activesupport (= 3.2.13)
      bundler (~> 1.0)
      railties (= 3.2.13)
    railties (3.2.13)
      actionpack (= 3.2.13)
      activesupport (= 3.2.13)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (10.1.0)
    rdoc (3.12.2)
      json (~> 1.4)
    sass (3.2.10)
    sass-rails (3.2.6)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    sprockets (2.2.2)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    thor (0.18.1)
    tilt (1.4.1)
    treetop (1.4.14)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.37)
    uglifier (2.1.2)
      execjs (>= 0.3.0)
      multi_json (~> 1.0, >= 1.0.2)

PLATFORMS
  ruby

DEPENDENCIES
  backbone-on-rails
  coffee-rails (~> 3.2.1)
  jquery-rails
  pg
  rails (= 3.2.13)
  sass-rails (~> 3.2.3)
  uglifier (>= 1.0.3)

这也是我的 database.yml

development:
  adapter: postgresql
  encoding: unicode
  database: poster_development
  host: localhost

# 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: postgresql
  encoding: unicode
  database: poster_test
  host: localhost

production:
  adapter: postgresql
  encoding: unicode
  database: poster_production

【问题讨论】:

    标签: sql ruby-on-rails postgresql heroku


    【解决方案1】:

    sqlite3 gem 是否在您的Gemfileproduction 组中?

    如果您使用 sqlite3 在本地进行开发,那么您可能希望在您的 Gemfile 中使用类似的内容。

    group :production do
      gem 'pg'
    end        
    
    group :development, :test do
      gem 'sqlite3'
    end
    

    别忘了运行bundle install

    【讨论】:

    • 抱歉,我刚刚编辑了我的帖子。我在 postgresql 上本地开发很好,我只是无法部署到 heroku
    • GemfileGemfile.lock 都致力于 Git 对吗?而这正是你要推动 Heroku 的?
    • 啊,谢谢。不知道 heroku 只推送提交的代码。谢谢!
    猜你喜欢
    • 2011-02-15
    • 2014-06-02
    • 1970-01-01
    • 2011-11-07
    • 2011-05-11
    • 1970-01-01
    • 2021-04-16
    • 2012-07-20
    • 2010-12-30
    相关资源
    最近更新 更多