我剛剛在我的Windows 7電腦上安裝了ruby。我用gem安裝了rails和sqlite3。然後我讓我的應用程序在本地工作,但我似乎仍然有問題與sqlite3。當我試試這個:不能讓sqlite3在Ruby on Rails上工作
rake db:create
我唯一得到的是一個錯誤:
Please install the sqlite3 adapter: "gem install activerecord-sqlite3-adapter" (sqlite3
is not part of the bundle. Add it to the GemFile).
我已經在這裏做,有一些挖,我能做出這樣錯誤消失加入這一行我的Gemfile:
gem "sqlite3", group: :sqlite3
,我得到了一個新的錯誤:
no driver for sqlite3 found
我試過'捆綁'命令,我有sqlite3和sqlite3-ruby,我重新安裝了一切,但問題不會消失。這是我的寶石文件,我希望它可以幫助:
source 'https://rubygems.org'
gem 'rails', '3.2.12'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
#I tried this too, but nothig changes
#gem 'sqlite3-ruby', :require => 'sqlite3'
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'
gem "sqlite3", group: :sqlite3
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
我真的不知道該怎麼做。這有點令人沮喪,似乎有些東西(顯然)不適合與sqlite3合作,因爲修復一個錯誤會導致新的錯誤。我該如何解決這個問題?
您是否試過'gem'sqlite3''?我假設你已經運行'bundle install' ...? – Chowlett 2013-03-09 13:48:31
是的,如果我保留「gem'sqlite3'」它說它不能加載sqlite3/sqlite3_native文件,這就是爲什麼我改變它,是的,我運行捆綁安裝 ... 使用rdoc(3.12.2) 使用雷神(0.17.0或更新) 使用railties(3.2.12) 使用咖啡導軌(3.2.2) 使用jQuery護欄(2.2.1) 使用Rails(3.2.12) 使用SASS(3.2。 7) 使用sqlite3(1.3.6) 使用sqlite3(1.3.7) 使用sqlite3-ruby(1.3.3) 使用uglifier(1.3.0) 您的包已完成!使用'bundle show [gemname]'查看安裝了捆綁的寶石 的位置。 這是! – G4bri3l 2013-03-09 14:09:20
sqlite3是否安裝在您的系統中? – Pigueiras 2013-03-09 18:05:16