Ruby on Rails-Road Error CCould not load' active_record/connection_adaptors/sqlite3_adapter 」

Asked 2 years ago, Updated 2 years ago, 84 views

http://railstutorial.jp/.
I installed Ruby 2.1 of RailsInstaller, and then I did what I saw on the page.
In 1.2.5, when I ran the rails server command and tried to start the local web server, several errors were encountered, so I solved the problem using a blog site.It was written that the resolved issue is specific to the Rails environment in Windows.For example, 'x64_mingw' is not a valid platform.However, the errors we are currently facing are similar to the following, and we were unable to get the desired information when searching.

Could not load 'active_record/connection_adaptors/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.

The Gemfile looks like this:As mentioned earlier, after editing as instructed in the tutorial, we made several edits to resolve the problems encountered by the rails server command.

source 'https://rubygems.org'
ruby '2.1.5'
# ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.1.0'

group —Development do
  gem'sqlite 3', '1.3.8'
end

gem'sass-rails', '4.0.5'
gem 'uglifer', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'
gem'tzinfo-data', platforms: [:mingw,:mswin,:x64_mingw]

group —docdo
  gem'sdoc', '0.3.20', require: false
end

What is the cause and solution of this error?Thank you for your cooperation.

ruby-on-rails ruby sqlite

2022-09-30 20:46

1 Answers

I think the version of Rails used in the Rails tutorial was 4.0.5, and the version of Ruby was 2.0.Why don't you try again to match the Ruby and Rails versions used in the Rails tutorial?

The Gemfile with the verified version number is as follows:
http://railstutorial.jp/chapters/beginning?version=4.0#sec-install_rails

source 'https://rubygems.org'
ruby '2.0.0'
# ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.5'

group —Development do
  gem'sqlite 3', '1.3.8'
end

gem'sass-rails', '4.0.5'
gem 'uglifer', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group —docdo
  gem'sdoc', '0.3.20', require: false
end


2022-09-30 20:46

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.