As far as I can tell, where it says "You need to install postgresql-server-dev-X. Y for building a server-side extension or libpq-dev for building a client-side application" it means that you need to install packages on your system for the gems to work.
So on fedora I had to yum install postgresql-devel. Since you're on Ubuntu I think you need to do. How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 6 years, 9 months ago. Active 5 years, 11 months ago. Viewed 8k times. The failure report is below: Building native extensions.
Improve this question. Oscar Courchaine Oscar Courchaine 3 3 silver badges 14 14 bronze badges. Add a comment. Active Oldest Votes. Since you're on Ubuntu I think you need to do sudo apt-get install libpq-dev You may also need build-essential so you could run sudo apt-get install libpq-dev build-essential. But lets face it, why install the full database server, when you only need a client interface?
So I started Googling around to see how other developers solved this issue. Now that you have installed libpq, you still need to install the pg gem. Specify the —with-opt-dir build option using the gem binary through the command line:. If you are using Install using bundler and it is most likely you are, you can save the build option in the bundler build config.
I have been developing and deploying a wide variety of online business and content applications. Now all gems are installed locally and ready to be used. This website uses cookies to improve your experience.
We'll assume you're ok with this, but you can opt-out if you wish. I also prefer not to use pre-compiled binary installations of Open Source tools, unless the maintainer has demonstrated a long-term commitment and expertise in building and maintaining the package.
There are two things that need to be installed, the Postgres server and the Ruby gem for the Postgres database driver. You will also want to add a launchd task for starting and stopping the database server. This requires that you create a dedicated user account and group, which only Postgres will use. This is done with the Directory Service command line utility, dscl.
Before creating the Postgres user you need to pick out internal ID numbers for the user and group. You need to find a number that is not currently in use, so start by seeing what is in use.
View the list of user accounts and ID numbers note that some output is elided :. Within these lists you want to find an ID number under that is not in use. From the output above, I chose , which met both criteria. With chosen user and group IDs, create the user. With the dedicated user and group created, you can now download, compile, and install Postgres. The source code distribution can be downloaded from one of the Posgresql. And leave it off, it is a known security risk.
0コメント