Go project build failed with error "gcc" not found

I am trying to deploy my Go project in a monorepo under backend sub-directory. I set the environment variable CGO_ENABLED=0 and use the build command go build --tags "sqlite_foreign_keys=1" -o out. I use the github.com/mattn/go-sqlite3 package and want the foreign keys to be enforced. When building I getting an error cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in $PATH. How do I proceed from here?
5 Replies
Percy
Percy2y ago
Project ID: 0fafb8bf-c167-4a53-8853-aa7aa4471951
salvaje_
salvaje_OP2y ago
0fafb8bf-c167-4a53-8853-aa7aa4471951 Correct project id: 8b8ebfbe-dd91-4bc1-acea-c334c7588844. The one above is a service id
Brody
Brody2y ago
this is not a direct solution to your problem, but you would want to stay away from sqlite databases as railway does not have persistent storage, every deploy would wipe your previous database, you would want to use one of the databases railway provides
salvaje_
salvaje_OP2y ago
hmm, ok. Thanks. Thankfully I made my app compatible with postgres as well I guess when persistent storage finally comes out, I can use it?
Want results from more Discord servers?
Add your server