0

I followed Heroku getting started from the beginning up to 'bundle install' (step #declare-app-dependencies) and saw an error. Some dependencies seem missing but I don't know how to find what they are. Can anybody tell what I should do?

$ 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.

Environment =

  1. linuxmint 64bit as VM guest
  2. ruby 2.0.0p299 (2013-08-29) [x86_64-linux-gnu]
  3. gem -v = 2.0.7
  4. gem list --local = bundler (1.7.3), i18n (0.6.9), rake (10.3.2)
  5. installed Heroku Toolbelt
  6. using the example code as in the instructions
Ksthawma
  • 1,257
  • 1
  • 16
  • 28
  • I tried to [install ruby-dev](http://stackoverflow.com/questions/13767725/unable-to-install-gem-failed-to-build-gem-native-extension-cannot-load-such?rq=1) and the same error is still present. – Ksthawma Sep 19 '14 at 06:15

1 Answers1

0

After hours of trial I could finally bundle install. I did

sudo apt-get purge ruby*
sudo apt-get install ruby
sudo apt-get install ruby-dev
sudo gem install bundler

After these, bundle install passed json-1.8.1 without error. Then error came

...
You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.
...

so I did

sudo apt-get install libpq-dev

Then bundle install again. And it read Your bundle is complete!.


For your reference, I did the following as well. I do not know if the Heroku getting started example really needs them.

sudo apt-get install postgresql postgresql-contrib
sudo apt-get install libmagickwand-dev python-dev
Ksthawma
  • 1,257
  • 1
  • 16
  • 28