2014-01-26 2 views
0

첫 번째 질문은 여기 있지만, 나는 stackoverflow가 마이클 하트 컷의 첫 번째 장에서 거의 15 번이나 도움이 되었기 때문에 지금 고맙습니다.Heroku에 대한 PostgreSQL gem pq Intalling

`

group :production do 
    gem 'pg', '0.15.1' 
    gem 'rails_12factor', '0.0.2' 
    end` 

하지만 내가 직접 설치하려고 그런

-bash: group: command not found 

오류를 보여줍니다

는 지금은이 명령의 PostgreSQL (페이지 보석)를 설치하려고 해요 (?)와 함께하는 보석

gem install pg 

그러나 그것은 또 다른 오류

`Fetching: pg-0.17.1.gem (100%) 



Building native extensions. This could take a while... 




ERROR: Error installing pg: 
     ERROR: Failed to build gem native extension. 



rvm/rubies/ruby-2.0.0-p353/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=/Users/trabalho/.rvm/rubies/ruby-2.0.0-p353/bin/ruby 
    --with-pg 
    --without-pg 
    --with-pg-config 
    --without-pg-config 
    --with-pg_config 
    --without-pg_config 
    --with-pg-dir 
    --without-pg-dir 
    --with-pg-include 
    --without-pg-include=${pg-dir}/include 
    --with-pg-lib 
    --without-pg-lib=${pg-dir}/ 

extconf failed, exit code 1 

Gem files will remain installed in .rvm/gems/[email protected]_rails_4_0/gems/pg-0.17.1 for inspection. 
Results logged to .rvm/gems/[email protected]_rails_4_0/extensions/x86_64-darwin-10/2.0.0/pg-0.17.1/gem_make.out` 

가 설치되거나되지 않은 경우 이해 할 수 없습니다, 나도 방법을 확인할 수를 보여줍니다. 그룹 명령을 어떻게 작동 시키나요? 아니면 gem pg와 rails_12factor를 어떻게 설치할 수 있습니까? 도움이 되었습니까?

답변

2

group ...을 터미널에서 명령으로 실행하고 싶지는 않지만 코드 블록을 레일 응용 프로그램의 Gemfile 안에 넣으십시오. Gemfile

group :production do 
    gem 'pg', '0.15.1' 
    gem 'rails_12factor', '0.0.2' 
end 

그런 다음 bundle 명령을 실행합니다.

그래도 pg 보석을 컴파일 할 수 없다면 xcode 명령 줄 도구가 설치되어 있어야합니다 (OSX를 사용 중이라고 가정). 이를 설치하려면 터미널에서 xcode-select --install을 실행하고 프롬프트를 따르십시오.

+0

너희들은 놀라운 나를 도왔다가, 해결, 감사 :이 라이브러리를 필요 것 같은데. – luigi

5

우분투를 실행하고 있습니까?

sudo apt-get install libpq-dev 

Source

+0

ubunto를 사용하고 있지 않습니다. OSX 10.6입니다. sudo는 무엇을합니까? – luigi

+0

아. 그런 다음 명령 줄 도구가 필요한 것 같습니다. 그들을 설치하려면 :'xcode-select --install'; 그런 다음 다시 시도하십시오. sudo는 수퍼 유저 권한으로 명령을 실행하며 관리자 암호가 필요합니다. – brittlewis12

+0

글쎄, 우분투 사용자이고, 저에게 감사합니다! –

0
sudo apt-get install libpq-dev 

는 우분투

관련 문제