簡體   English   中英

捆綁安裝在生產服務器上失敗

[英]Bundle install fails on production server

我有一個Rails應用程序,最近我推送到了“生產” VPS托管服務器。 我使用Capistrano進行了部署,它似乎已經可以很好地部署到服務器上了。 我更改為應用程序的當前目錄,並運行捆綁安裝以開始進行所有設置並遇到此錯誤:

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/local/rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20151105-8574-y7clqw.rb 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.

我不熟悉此錯誤,這對我來說是未知的領域,所以我有點迷茫。 我能夠使用來自postgresql Wiki的此信息在服務器上獲取postgres

我相當確定這是一個簡單的修復程序,我只是不熟悉設置新服務器,所以我不確定我在這里做什么!

編輯:

如下面的建議,我將lib和dev包添加到了服務器中。 我在/usr/pgsql-9.3/bin中找到了/usr/pgsql-9.3/bin ,但是我的應用程序似乎找不到它,導致上面的錯誤。 當我嘗試按照上述錯誤輸出中的建議執行$ bundle install --with-pg-config=/usr/pgsql-9.3/bin ,我收到一個Unknown switches '--with-pg-config=/usr/pgsql-9.3/bin'錯誤。

我應該如何映射到文件? 還有我不了解的事情嗎?

ssh進入生產機器並在該機器上安裝postgresql-devel軟件包,這將解決pg_config missing的問題:

sudo apt-get install libpq-dev

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM