I wanna create myApp using command
rails new myApp
but it gives an error:
Installing sqlite3 (1.3.4) wit
I had the same issue but in Windows.
I found only two solutions for now
1* After the project creation fail, enter in its folder and modify the Gemfile.
Change the line
gem 'sqlite3', '1.3.11'
by one of these bellow:
gem 'sqlite3', git: "https://github.com/sparklemotion/sqlite3-ruby"
gem 'sqlite3', git: "https://github.com/sparklemotion/sqlite3-ruby", branch: "add-gemspec"
gem 'sqlite3', git: "https://github.com/larskanis/sqlite3-ruby", branch: "add-gemspec"
And run again the bundle install
command for this project
The second solution I found was downloading the gem from https://rubygems.org/ and saving it locally to install from file, first, you've to install mingw (but only for Windows)
C:\Sites>ridk exec pacman -S mingw-w64-x86_64-dlfcn
C:\Sites>gem install --local C:\sqlite3-1.4.0.gem
I've tried some others solutions but these two were the only ones worked for me.
https://mycodeissuesandfixes.blogspot.com/2019/02/ruby-on-rails-issue-about-sqlite-3-gem.html Those are others fixes but I don't know if they're going to help you in Linux. Hope it helps!! I've been trying for 5 days completes until I found something that works with this error of sqlite 3 gem
Make sure you have the development headers for SQLite3 installed.
For example:
On Ubuntu, you can use apt-get install libsqlite3-dev
On Mac with homebrew installed: brew install sqlite
.
I've found it pretty helpful to run this command whenever I install rails anew on Ubuntu. This normally takes care of the super common zlib and sqlite3 errors.
/usr/bin/apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev