I'm trying to run rails server and there is problem with sqlite3.
When i run bin/rails server
Could not find gem 'sqlite3 (~> 1.4)' in locally installed gems.
Run
bundle installto install missing gems.
So i try to run bundle install
Installing sqlite3 1.4.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
And the last thing I tried is checking the log file in /var/lib/gems/2.7.0/extensions/x86_64-linux/2.7.0/sqlite3-1.4.2/mkmf.log
package configuration for sqlite3 is not found find_header: checking for sqlite3.h... -------------------- no
"x86_64-linux-gnu-gcc -o conftest -I/usr/include/x86_64-linux-gnu/ruby-2.7.0 -I/usr/include/ruby-2.7.0/ruby/backward -I/usr/include/ruby-2.7.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/ruby2.7-aN7IdK/ruby2.7-2.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -L. -L/usr/lib/x86_64-linux-gnu -L. -Wl,-z,relro -Wl,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic -lruby-2.7 -lm -lc"
checked program was:
/* begin */ 1: #include "ruby.h" 2: 3: int main(int argc, char **argv) 4: { 5: return !!argv[argc]; 6: } /* end */"x86_64-linux-gnu-gcc -E -I/usr/include/x86_64-linux-gnu/ruby-2.7.0 -I/usr/include/ruby-2.7.0/ruby/backward -I/usr/include/ruby-2.7.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2 -g -O2 -ffile-prefix-map=/build/ruby2.7-aN7IdK/ruby2.7-2.7.3=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c -o conftest.i" conftest.c:3:10: fatal error: sqlite3.h: No such file or directory
3 | #include <sqlite3.h> | ^~~~~~~~~~~ compilation terminated.checked program was:
/* begin */ 1: #include "ruby.h" 2: 3: #include <sqlite3.h> /* end */
Any suggestion?
gem 'sqlite3'line bygem ‘sqlite3’, git: “https://github.com/larskanis/sqlite3-ruby", branch: “add-gemspec”and then try bundle install again - ChandanGemfile: Undefined local variable or method `“add' for Gemfile. Bundler cannot continue. # from /home/chip/rbonrails/blog/Gemfile:9 # ------------------------------------------- # # Use sqlite3 as the database for Active Record > gem 'sqlite3', "git: “github.com/larskanis/sqlite3-ruby", branch: “add-gemspec” # # Use Puma as the app server > # ------------------------------------------- - Chip1-3-stableand or remove then try - Chandan