我从一开始就跟着Heroku getting started进行了捆绑安装' (step#declare-app-dependencies)并看到一个错误。似乎缺少一些依赖,但我不知道如何找到它们是什么。谁能告诉我应该做什么?
$ bundle install
Fetching gem metadata from https://rubygems.org/...........
Resolving dependencies...
Using rake 10.3.2
Using i18n 0.6.9
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby2.0 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
Gem files will remain installed in /tmp/bundler20140919-3839-1mafrop/json-1.8.1/gems/json-1.8.1 for inspection.
Results logged to /tmp/bundler20140919-3839-1mafrop/json-1.8.1/gems/json-1.8.1/ext/json/ext/generator/gem_make.out
An error occurred while installing json (1.8.1), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.1'` succeeds before bundling.
环境=
答案 0 :(得分:0)
经过数小时的试用,我终于bundle install
了。我做了
sudo apt-get purge ruby*
sudo apt-get install ruby
sudo apt-get install ruby-dev
sudo gem install bundler
在这些之后,bundle install
没有错误地传递了json-1.8.1。然后错误来了
...
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
...
所以我做了
sudo apt-get install libpq-dev
再次bundle install
。它读了Your bundle is complete!
。
供您参考,我也做了以下工作。我不知道Heroku getting started示例是否确实需要它们。
sudo apt-get install postgresql postgresql-contrib
sudo apt-get install libmagickwand-dev python-dev