0

我知道这是一个老问题,我看到许多与同一问题相关的问题。我仍然不断收到同样的错误。我遵循了解决方案并相应地更改了我的 gemfile,但我仍然遇到同样的问题。我正在使用 ubuntu。下面是我在运行 git push heroku master 时遇到的问题,如 Michael Hartl 的教程中所述:

Could not create Makefile due to some reason, probably lack of
       necessary libraries and/or headers.  Check the mkmf.log file for more
       details.  You may need configuration options.
       Provided configuration options:
       --with-opt-dir
       --without-opt-dir
       --with-opt-include
       --without-opt-include=${opt-dir}/include
       --with-opt-lib
       --without-opt-lib=${opt-dir}/lib
       --with-make-prog
       --without-make-prog
       --srcdir=.
       --curdir
       --ruby=/usr/local/bin/ruby
       --with-sqlite3-dir
       --without-sqlite3-dir
       --with-sqlite3-include
       --without-sqlite3-include=${sqlite3-dir}/include
       --with-sqlite3-lib
       --without-sqlite3-lib=${sqlite3-dir}/lib
       --enable-local
       --disable-local
       Gem files will remain installed in /tmp/build_t7ck4nq1x4dd/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6 for inspection.
       Results logged to /tmp/build_t7ck4nq1x4dd/vendor/bundle/ruby/1.9.1/gems/sqlite3-1.3.6/ext/sqlite3/gem_make.out
       An error occurred while installing sqlite3 (1.3.6), and Bundler cannot continue.
       Make sure that `gem install sqlite3 -v '1.3.6'` succeeds before bundling.
 !
 !     Failed to install gems via Bundler.
 !
 !     Heroku push rejected, failed to compile Ruby/rails app

To git@heroku.com:pure-dusk-8885.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@heroku.com:pure-dusk-8885.git'

这是我的 Gemfile

source 'https://rubygems.org'

gem 'rails', '3.2.5'

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

group :production do 
  gem 'pg'
end

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

# 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'

# 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'

请帮忙

4

2 回答 2

0

从您的 Gemfile 中删除 sqlite3。仅使用pggem 进行开发,这样您就可以在与要部署到的数据库系统完全相同的数据库系统上进行开发。

如果您不这样做,那么在两个数据库系统之间转换时可能会遇到问题。

于 2012-07-09T02:07:01.833 回答
0

正如 Ryan Bigg 所说,您应该在开发和生产中拥有相同的环境,这样您以后部署到生产时就不会感到意外。

但是,如果您不关心这一点并想继续使用 sqlite,我认为您只需要运行bundle install. 我猜您更改了 GemFile 但没有运行捆绑安装。

于 2012-07-09T02:09:45.627 回答