0

how's going? I trying to create my first application with Ruby on Rails, I can create the project but I can't run the server. My OS is Windows. I installed Node, Yarn, Ruby, Rails, Sqlite3. This message appears when I try to run "rails s"

Could not find gem 'sqlite3' in locally installed gems.
Run `bundle install` to install missing gems.

I run the command "bundle install", "bundle update" and doesn't work. This message appears when I run "bundle install":

An error occurred while installing sqlite3 (1.4.2), and Bundler cannot continue.

In Gemfile:
  sqlite3

When I verify the version of sqlite3: enter image description here I tried editing Gemfile:

gem 'sqlite3', '~> 1.4.2'

And tried install this way:

gem install sqlite3 -v '1.4.2' --source 'https://rubygems.org/'

I tried this steps too: https://www.youtube.com/watch?v=cAseoJeNG8I

I follow the recommendation in the documentation for windows users and run "bin/rails s" on Bash, but still the same problem. I read other answers here to similar questions but did not help me, for this I ask with this. If something was a miss to you understand the problem please tell me and I provide the information. Thanks, everyone.

2 Answers2

0

The above Error occurred because sqlite3 is not installed on your system.

Step1:- First, install the sqlite3 on your system by following the steps mention here

Step2:- Run bundle install

  • When I verify the version this appears: 3.37.0 2021-11-27 14:13:22 bd41822c7424d393a30e92ff6cb254d25c26769889c1499a18a0b9339f5d6c8a. I put sqlite3 dll/exe in bin folder how described in the question that you mention. I put the version in gemfile '1.4.1' doesn't work too. Just steps mention by use autoconfig that I didn't because I don't know how compile .configure. – Gabriel Baldez Dec 20 '21 at 19:14
0

Have you tried deleting gemfile.lock? Try delete and after that again type bundle install

Mikołaj Wittbrodt
  • 399
  • 1
  • 4
  • 18
  • I search in my project and there aren't gemfile.lock only gemfile. Would a good idea reinstall the Rails? – Gabriel Baldez Dec 21 '21 at 13:48
  • Maybe it's a good idea. As I know gemfile.lock is mandatory because it's shows us all of ours installed gems. Try it and give us a feedback – Mikołaj Wittbrodt Dec 21 '21 at 14:34
  • Now generated gemfile.lock. But when I try run `rails s` this message appears **cannot load such file -- sqlite3/sqlite3_native (LoadError)** – Gabriel Baldez Dec 21 '21 at 18:50
  • [link](https://stackoverflow.com/questions/17643897/cannot-load-such-file-sqlite3-sqlite3-native-loaderror-on-ruby-on-rails) try solve problem like in this link. – Mikołaj Wittbrodt Dec 22 '21 at 06:55