rails_4.2.11.1_新不加载'sqlite3'
rails _4.2.11.1_ new does not load 'sqlite3'
我是 rails 的新手,正在尝试使用 rvm
rvm use 2.4.1
rails _4.2.11.1_ new hello_app
cd hello_app
rails s
与 Rails 5 一起使用但在我的 Mac
上与 rails 4 和 ruby 2.4.1 一起失败
Gem::LoadError (Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).):
activerecord (4.2.11.1) lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec'
我的 Gemfile 是 rails 新生成的,没有注释
source 'https://rubygems.org'
gem 'rails', '4.2.11.1'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
runtimes
gem 'jquery-rails'
more: https://github.com/rails/turbolinks
gem 'turbolinks'
https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
只是因为rails找不到需要的gem的确切版本,请在下面明确提供版本,
gem 'sqlite3', '~> 1.3.6'
你可以找到参考资料here
如果它不起作用,请改变版本并尝试 gem 文件中的 gem 'sqlite3', '~> 1.3.0'
。
我是 rails 的新手,正在尝试使用 rvm
rvm use 2.4.1
rails _4.2.11.1_ new hello_app
cd hello_app
rails s
与 Rails 5 一起使用但在我的 Mac
上与 rails 4 和 ruby 2.4.1 一起失败Gem::LoadError (Specified 'sqlite3' for database adapter, but the gem is not loaded. Add `gem 'sqlite3'` to your Gemfile (and ensure its version is at the minimum required by ActiveRecord).):
activerecord (4.2.11.1) lib/active_record/connection_adapters/connection_specification.rb:177:in `rescue in spec'
我的 Gemfile 是 rails 新生成的,没有注释
source 'https://rubygems.org'
gem 'rails', '4.2.11.1'
gem 'sqlite3'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.1.0'
runtimes
gem 'jquery-rails'
more: https://github.com/rails/turbolinks
gem 'turbolinks'
https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc
group :development, :test do
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
只是因为rails找不到需要的gem的确切版本,请在下面明确提供版本,
gem 'sqlite3', '~> 1.3.6'
你可以找到参考资料here
如果它不起作用,请改变版本并尝试 gem 文件中的 gem 'sqlite3', '~> 1.3.0'
。