Project

General

Profile

can not use 'bundle intall' installing the necessary gems

Added by 敏 李 almost 12 years ago

systems:CentOS5.6*64
test test
----------------
these were successfully installed

REDMINE 2.0.3 /opt/redmine
ruby 1.9.2 /usr/local/ruby
rubygems 1.6.2
rails:3.2.6(gem install rails v=3.2.6)
bundle :1.4.2
yum install gcc gcc-c++
yum y install zlib-devel curl-devel openssl-devel httpd-devel apr-devel apr-util-devel mysql-devel
---------------------------------------------------

then i use this command to Install the provided dependencies
cd /opt/redmine
bundle install
it ended with this error of this meanings
pg was not installed on this computer
then i use gem to install the pg
gem install pg -v=0.4.0
but it could not installed

please help me

use the command under the redmine catalog : 'bundle install'
Installing pg (0.14.0) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/usr/local/ruby/bin/ruby extconf.rb
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
•extconf.rb failed ***
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/ruby/bin/ruby
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config

Gem files will remain installed in /usr/local/ruby/lib/ruby/gems/1.8/gems/pg-0.14.0 for inspection.
Results logged to /usr/local/ruby/lib/ruby/gems/1.8/gems/pg-0.14.0/ext/gem_make.out
An error occured while installing pg (0.14.0), and Bundler cannot continue.
Make sure that `gem install pg -v '0.14.0'` succeeds before bundling.

PG cannot intsall


Replies (2)

RE: can not use 'bundle intall' installing the necessary gems - Added by harch schoolboy almost 12 years ago

if you're not using postgres and using mysql, you can simply comment this lines

# Database gems
#platforms :mri, :mingw do
#  group :postgresql do
#    gem "pg", ">= 0.11.0" 
#  end

#  group :sqlite do
#    gem "sqlite3" 
#  end
#end

RE: can not use 'bundle intall' installing the necessary gems - Added by Dies Koper almost 12 years ago

You can skip gems you don't need using bundle's "--without" option.
E.g. if you don't want to use PostgreSQL, you can simply run

bundle install --without=pg

If you use sqlite for example, and don't use openid and rmagick, use

bundle install --without=test pg mysql2 mysql openid rmagick

However, if you do want to use PostgreSQL, install it first using

gem install pg -- --with-pg-lib=/opt/PostgreSQL/9.1/lib --with-pg-config=/opt/PostgreSQL/9.1/bin/pg_config

    (1-2/2)