0

Right after launching rails server command Ruby terminal doesn't start the server and writes following:

C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:6:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
    from C:/Sites/testing/config/application.rb:7:in `<top (required)>'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `require'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `block in server'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
    from C:/tools/ruby23/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands.rb:18:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

When looking for answers to similar question, I haven't found any working solution. I can say that:

  1. Application is created in directory, in which path are only English symbols.
  2. I tried to fix problem using: gem cleanup bundle install
  3. I tried to start the server using: bundle exec rails server.
  4. I tried to delete the gems which contain "problem" in the gemfile.
  5. Also tried to fully reuninstall Ruby and Rails with all gems.

All that didn't help, so I would really appreciate for working in my case solution!

P.S. I am working on: Windows 8.1 (64-bit), Ruby 2.3.0, Rails 5.0.0

  • Possible duplicate of [cannot load such file -- sqlite3/sqlite3\_native (LoadError) on ruby on rails](http://stackoverflow.com/questions/17643897/cannot-load-such-file-sqlite3-sqlite3-native-loaderror-on-ruby-on-rails) – Hasmukh Rathod Aug 04 '16 at 00:21

1 Answers1

1

Find your sqlite3 gemspec file. One example is

`/usr/local/share`/gem/specifications/sqlite3-1.3.7.gemspec`

Windows: C:\Ruby21\lib\ruby\gems\2.1.0\specifications.

You should adjust according with your Rubygem path and sqlite3 version. Edit the file above and look for the following line

s.require_paths=["lib"]

change it to

s.require_paths= ["lib/sqlite3_native"]

Hope that helps!!!

Muhammad Yaseen
  • 361
  • 3
  • 21
  • Unfortunately, that also didn't work. I tried your solution and the server started normally, but its homepage (e.g. localhost:3000) said following: "Could not load 'active_record/connection_adapters/sqlite3_adapter'. Make sure that the adapter in config/database.yml is valid. If you use an adapter other than 'mysql', 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile." – mkorcevskis Aug 04 '16 at 13:49
  • Make sure that you have gem 'sqlite3' in your Gemfile. – Muhammad Yaseen Aug 04 '16 at 13:59