【问题标题】:Heroku error with installing installing sqlite3 (1.3.7)Heroku 安装安装 sqlite3 (1.3.7) 时出错
【发布时间】:2013-05-12 02:35:30
【问题描述】:

我创建了一个小型 Rails 应用程序,我想部署它。推送到 Heroku 时出现错误。我知道这个问题已经被问过了,但没有一个解决方案对我有用。我在 Ubuntu 上。这就是错误所说的:

 Bundler cannot continue.
       Make sure that `gem install sqlite3 -v '1.3.7'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

这是 Gemfile。

source 'https://rubygems.org'

gem 'rails', '3.2.13'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'



# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'

  # See https://github.com/sstephenson/execjs#readme for more supported runtimes
  # gem 'therubyracer', :platforms => :ruby

  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

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

gem 'pg'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# To use Jbuilder templates for JSON
# gem 'jbuilder'

# Use unicorn as the app server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'debugger'

【问题讨论】:

  • 你在bundle install之前尝试过命令gem install sqlite3 -v '1.3.7'
  • 是的,我仍然遇到同样的错误..
  • 创建一个新的gemset并尝试使用不同的gemset

标签: ruby-on-rails ruby ubuntu heroku gem


【解决方案1】:

我认为在 Rails 应用程序中使用 postgresql 和 sqlite3 之间存在冲突。您已将 sqlite3 设置为在开发和测试中运行,但还编写了 postgresql 在生产、开发和测试中运行。我建议将 postgresql gem 指定为仅在生产环境中运行。

group :production do
  gem 'pg'
end

【讨论】:

  • 我仍然遇到同样的错误。我遇到了与此类似的问题,但是在安装 pg gem 时,为了解决它,我必须先运行 sudo apt-get install postgresql libpq-dev,然后再运行 bundle install。我不确定这个问题是否也是这种情况。
  • 你试过安装gem install sqlite3然后运行bundle install吗?
【解决方案2】:

我想通了!我认为问题在于我在本地安装了生产 gem,这导致 Heroku 出现错误。我更新了我的 gemfile,然后运行了 bundle update,然后主要的步骤是运行 bundle install --without production

source 'https://rubygems.org'

gem 'rails', '3.2.13'

group :development do
  gem 'sqlite3', '1.3.5'
end


# Gems used only for assets and not required
# in production environments by default.
group :assets do
  gem 'sass-rails',   '3.2.5'
  gem 'coffee-rails', '3.2.2'

  gem 'uglifier', '1.2.3'
end

gem 'jquery-rails', '2.0.2'

group :production do
  gem 'pg', '0.12.2'
end

【讨论】:

    猜你喜欢
    • 2013-08-23
    • 2013-03-11
    • 2015-07-13
    • 1970-01-01
    • 1970-01-01
    • 2013-08-26
    • 2013-07-21
    • 2012-04-17
    • 2014-07-10
    相关资源
    最近更新 更多