0

Just installed Ruby on Rails 5 on Windows 10. I tried to run the rails server but it gave me the error below. I've tried a bunch of different solutions but nothing seems to work, probably because most of the suggestions were before RoR4. I've updated my PATH/environment variable and extracted the DLL and executable from the sqlite website and put that into my directory, ran bundle install...

C:/Ruby23-x64/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:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:86:in `block (2 levels) in require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `each'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:81:in `block in require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `each'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler/runtime.rb:70:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/bundler-1.12.5/lib/bundler.rb:102:in `require'
        from C:/Users/Tim/Documents/GitHub/event-registration-system/config/application.rb:7:in `<top (required)>'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:88:in `block in server'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `tap'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:85:in `server'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/railties-5.0.0/lib/rails/commands/commands_tasks.rb:49:in `run_command!'
        from C:/Ruby23-x64/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>'
Timothy Chen
  • 374
  • 1
  • 15
  • Have you seen [this question](http://stackoverflow.com/questions/17643897/cannot-load-such-file-sqlite3-sqlite3-native-loaderror-on-ruby-on-rails)? – MarsAtomic Jul 20 '16 at 02:16
  • Hm...I did try that before I posted here and it didn't work, but now it's working but giving me a different error when I run localhost:3000 – Timothy Chen Jul 20 '16 at 02:21
  • 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 'mysql2', 'postgresql' or 'sqlite3' add the necessary adapter gem to the Gemfile. – Timothy Chen Jul 20 '16 at 02:22
  • Have you tried to uninstall and reinstall the sqlite3 gem? Also, how is sqlite3 referenced in your gemfile? – MarsAtomic Jul 20 '16 at 06:24
  • Yep, tried that. In the gemfile: `gem 'sqlite3'` – Timothy Chen Jul 20 '16 at 13:34
  • Ended up just reinstalling everything with RailsInstaller which worked. Thank you for all of your help! :) – Timothy Chen Jul 20 '16 at 13:36

1 Answers1

2

I ended up just uninstalling everything and then using RailsInstaller to set up my Rails environment for Windows and this problem was resolved. Rails 5 does work with sqlite now.

I'm not sure what the problem was, but this was the solution that worked for me. Wanted to post it here in case anyone else was experiencing this on the newer versions of the language or framework.

Timothy Chen
  • 374
  • 1
  • 15