imdrasil / jennifer_sqlite3_adapter

SQLite3 adapter for Jennifer ORM
MIT License
13 stars 7 forks source link

sqlite3: not found #47

Closed Victor7095 closed 1 year ago

Victor7095 commented 1 year ago

I am attempting to create a sample Kemal application using jennifer and sam and I get the above error when running command make sam db:create.

database.cr:

require "jennifer"
require "jennifer_sqlite3_adapter"

APP_ENV = ENV["APP_ENV"]? || "development"

Jennifer::Config.configure do |conf|
  conf.adapter = "sqlite3"
  conf.host = "."
  conf.db = "test.db"
end

Log.setup "db", :debug, Log::IOBackend.new(formatter: Jennifer::Adapter::DBFormatter)

shard.yml:

version: 0.1.0

authors:
  - your-name-here <your-email-here>

targets:
  travels_api:
    main: src/travels_api.cr

dependencies:
  kemal:
    github: kemalcr/kemal
  jennifer:
    github: imdrasil/jennifer.cr
    version: "~> 0.12.0"
  sqlite3:
    github: crystal-lang/crystal-sqlite3
    version: "0.18.0"
  jennifer_sqlite3_adapter:
    github: imdrasil/jennifer_sqlite3_adapter
    version: "~> 0.4.0"
  sam:
    github: imdrasil/sam.cr
    version: 0.4.2

crystal: 1.8.2

license: MIT

Comand result:

lib/jennifer/src/jennifer/adapter/command_shell/i_command_shell.cr:19:9 in 'invoke'
lib/jennifer/src/jennifer/adapter/command_shell/bash.cr:14:9 in 'execute'
lib/jennifer/src/jennifer/adapter/db_command_interface.cr:24:9 in 'execute'
lib/jennifer_sqlite3_adapter/src/sqlite3/command_interface.cr:12:9 in 'create_database'
lib/jennifer/src/jennifer/adapter/base.cr:216:9 in 'create_database'
lib/jennifer/src/jennifer/migration/runner.cr:36:11 in 'create'
lib/jennifer/src/jennifer/sam.cr:36:5 in '->'
lib/sam/src/sam/task.cr:56:39 in 'call'
lib/sam/src/sam/execution.cr:19:7 in 'invoke'
lib/sam/src/sam.cr:37:5 in 'invoke'
lib/sam/src/sam.cr:55:7 in 'process_tasks'
lib/sam/src/sam.cr:43:5 in 'help'
sam.cr:13:1 in '__crystal_main'
/usr/share/crystal/src/crystal/main.cr:115:5 in 'main_user_code'
/usr/share/crystal/src/crystal/main.cr:101:7 in 'main'
/usr/share/crystal/src/crystal/main.cr:127:3 in 'main'
/lib/x86_64-linux-gnu/libc.so.6 in '??'
/lib/x86_64-linux-gnu/libc.so.6 in '__libc_start_main'
/root/.cache/crystal/crystal-run-sam.tmp in '_start'
???
DB command interface exit code 127: --: 1: sqlite3: not found

make: *** [Makefile:7: sam] Error 1
Victor7095 commented 1 year ago

Nevermind. Had to install sqlite3: sudo apt install sqlite3