我有我的Gemfile中的sqlite3寶石。運行「軟件包安裝」可正常運行。問題與sqlite3寶石同時使用紅寶石,sinatra&耙
rake db:create_migration NAME=create_messages
我得到以下錯誤:當使用耙運行dababase遷移
rake aborted!
LoadError: Could not load 'active_record/connection_adapters/sqlite_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.
我甚至嘗試指定sqlite3的有1.3.3,然後與1.3.4版本中的Gemfile但是,這並沒有解決問題。 Ruby的版本是1.9.3
下面是我的environments.rb文件:
configure :development do
set :database, 'sqlite:///dev.db'
set :show_exceptions, true
end
以下是從的Gemfile:
source 'https://rubygems.org'
#ruby "1.9.3"
gem "sinatra"
gem "activerecord"
gem "sinatra-activerecord"
gem 'sinatra-flash'
gem 'sinatra-redirect-with-flash'
group :development do
gem 'sqlite3-ruby'
gem "tux"
end
我也試圖在地方的sqlite3 - 紅寶石,但sqlite3的這並沒有解決問題。
顯示你的database.config。我認爲你使用'sqlite'適配器而不是'sqlite3'。 哦,顯示你的「設置:數據庫」 –
@IgorPavlov - 我試圖更新我的文章 - 任何想法?謝謝 – user3813256