vapor-community / postgresql

Robust PostgreSQL interface for Swift
MIT License
131 stars 33 forks source link

PostgreSQL Vapor Packages won't compile after install #57

Closed Red3nzo closed 6 years ago

Red3nzo commented 7 years ago

I installed PostgreSQL on my Mac and installed the PostgreSQL provider to my project but after I run my project it says how libpq-fe.h isn't found and also I've noticed the whole CPostgreSQL folder is empty under Dependencies. It also saysCould not build Objective-C module CPostgreSQL I'm guessing that's because the folder is empty. I have no clue how to fix this any any help would be greatly appreciated.

vzsg commented 7 years ago

The fact that CPostgreSQL is empty is normal, it's a system module so it has no visible sources in Xcode.

But how did you install Postgres? If you install it with Homebrew, and Homebrew is installed in the default location, things should just work. But only then.

Red3nzo commented 7 years ago

@vzsg I used the PostgreSQL app from their website for MacOS. I'm guessing this has to do with the problem

Red3nzo commented 7 years ago

Alright after an hour of looking I figured out the solution. Under Dependencies I installed the line .Package(url: "https://github.com/vapor/postgresql.git", majorVersion: 2) .

Full Code

dependencies: [ .Package(url: "https://github.com/vapor/vapor.git", majorVersion: 2), .Package(url: "https://github.com/vapor/fluent-provider.git", majorVersion: 1), .Package(url: "https://github.com/vapor/postgresql.git", majorVersion: 2), .Package(url: "https://github.com/vapor-community/postgresql-provider.git", majorVersion: 2, minor: 0) ]