轨 _4.2.11.1_ new 不加载'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,这是没有评论的新生成的轨迹

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'

您可以在此处找到参考

如果它不起作用,请改变版本,然后在gemfile中尝试为 gem 'sqlite3', '~> 1.3.0'

最新更新