0

I'm using Ruby 2.3.1 on Windows 7. Based on http://guides.rubyonrails.org/getting_started.html I tried to create a Rails 5 app afresh, but without success due to gem sqlite3-1.3.11.

The first error after "rails start" was "cannot load such file -- sqlite3/sqlite3_native (LoadError)". The problem was solved by Error when starting the Rails server on Windows . That's okay.

But it was impossible for me to fix the second error (LoadError in browser): "Could not load 'active_record/connection_adapters/sqlite3_adapter'."

Who can help?

Community
  • 1
  • 1
dd_hk
  • 110
  • 7

1 Answers1

0

This problem may be sqlite is not correclty installed

Firstly check your gem file for line gem 'sqlite3' if not add and run bundle install if problem still persists follow the steps below:

  1. Go to rubyinstaller.org
  2. Download Devkit and setup
  3. Remove Sqlite3 Gem by running gem uninstall sqlite3
  4. Reinstall sqlite3 by running gem install sqlite3
  5. Include gem 'sqlite3' in Gemfile

If still doesn't work your problem is due to version of ruby you are using. Please downgrade your ruby version or Install linux in your machine. I had also used ruby in windows and this actually caused headache and I switched it into linux.

Pradeep Sapkota
  • 2,041
  • 1
  • 16
  • 30
  • Sqlite3 (newest version) was installed and added to Windows Path before downloading the gem. This is not the cause of the problem. – dd_hk Aug 09 '16 at 05:54
  • Steps 1 to 5 were all performed several times before I asked the question yesterday. – dd_hk Aug 09 '16 at 07:16
  • Thanks Pradeep, maybe you are right. It's a pity that Rails cannot be used by Windows users easily. – dd_hk Aug 09 '16 at 07:31