While running bundle install i am getting the following error in 'pg' gem i changed the gem as sqlite then too am getting same error. This is my error message.
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:2:in `<main>'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/pg-0.16.0 for inspection.
Results logged to /var/lib/gems/1.9.1/gems/pg-0.16.0/ext/gem_make.out
An error occurred while installing pg (0.16.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.16.0'` succeeds before bundling.
I tried apt-get install libpg-dev
gem install pg -v '0.16.0'
nothing helps me
You should have postgresql installed before you install pg gem.
sudo add-apt-repository ppa:pitti/postgresql
sudo apt-get update
sudo apt-get install postgresql libpq-dev
If your sqlite is not working, it looks like there are some packages you might have missed.
sudo apt-get install libreadline-dev libssl-dev zlib1g-dev build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev
On Ubuntu 14.04 (and possibly every other Debian 7 based distro) this problem is caused by the absence of the Ruby development package. Thus the fix is simply to install it:
sudo apt-get install ruby1.9.1-dev
I have the same problem i solved it by installing it in ubuntu
as normal user not as root user
. I hope this may help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With