0

I am starting to build Ruby on Rails project, but can't start the server, because sqlite3 is not installed

`require': cannot load such file -- sqlite3/sqlite3_native (LoadError).

I downloaded Precompiled Binaries for Windows archive from the sqlite site, where do I save the files now? What should I type in the terminal window?

3
  • 1
    Have you run bundle install in the console before stating rails server?
    – mrzasa
    Nov 29, 2018 at 14:00
  • yes. the error is still there. I just dont know where do i place the sql files? Nov 29, 2018 at 16:02
  • 1
    I would skip SQLite altogether and instead go straight to the DB you are going to use in production such as Postgres (SQLite is not really a good choice for a web server). Developing on a different database will sooner or later result in errors slipping into production. You can find docker containers that are pre-installed with everything you need which will also spare you a lot of the pain of trying to get things to work on windows.
    – max
    Nov 29, 2018 at 16:13

2 Answers 2

1

To use sqlite3,

  1. Unpack the precompiled Binaries for Windows in C:\WINDOWS\system32 folder.

  2. Then on your cmd, do a "gem install sqlite3".

[That should fix it. To test:]

  1. Create a rails app. "rails new test"

  2. cd into the directory and "rails g scaffold post title:string body:text"

  3. "rails db:migrate"

2
  • Nope. I placed the files into system32 directory, tried to run the server again, and it still gives me the same error Dec 1, 2018 at 12:41
  • For my installation on windows, I used a rails installer, and so you'll find my sqlite3.dll & sqlite3.def in C:\RailsInstaller\Ruby2.3.3\bin. You might also want to check your variable path to see if system32 or ruby2.x.x/bin has been added
    – ohiodn8
    Dec 2, 2018 at 3:54
0

So the only way i got to install sqlite3 is by running RailsInstaller (http://railsinstaller.org/en). It installs the whole bundle of programs for Ruby on Rails app though.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.