goto_10 goto_10 - 2 months ago 32
Swift Question

Vapor SQLite missing module CSQLiteMac

I'm trying to add SQLite to a Vapor app but not having much luck. Here is what I have done to add it to the project and the error I get in Xcode when I try an build it. The error is in Sqlite.swift on the import statement: "No such module 'CSQLiteMac'" I know there is a missing framework somewhere but I just can't seem to track down what I'm missing and my google fu is failing me.

myke$ brew update
Already up-to-date.

myke$ brew install sqlite3 libsqlite3-dev
Error: No available formula with the name "libsqlite3-dev"
==> Searching for similarly named formulae...
Error: No similarly named formulae found.
==> Searching taps...
Error: No formulae found in taps.
==> You haven't updated Homebrew in a while.
A formula for libsqlite3-dev might have been added recently.
Run `brew update` to get the latest Homebrew updates!

myke$ vapor build --clean
Cleaning [Done]
No Packages folder, fetch may take a while...
Fetching Dependencies [Done]
Building Project [Done]

myke$ vapor xcode
Fetching Dependencies [Done]
Generating Xcode Project [Done]
Select the `App` scheme to run.
Open Xcode project?
y/n>n


My Package file:

import PackageDescription

let package = Package(
name: "kanban",
dependencies: [
.Package(url: "https://github.com/vapor/vapor.git", majorVersion: 1, minor: 0),
.Package(url: "https://github.com/vapor/sqlite-provider.git", majorVersion: 1, minor: 0)
],
exclude: [
"Config",
"Database",
"Localization",
"Public",
"Resources",
"Tests",
]
)

Answer

Just use

brew install sqlite3

The sqlite3 package is never getting installed because it's failing on

Error: No available formula with the name "libsqlite3-dev"