[英]ActiveRecord::ConnectionNotEstablished for new project
[英]ActiveRecord::ConnectionNotEstablished after cloning a GitHub project?
我最近在更換機器后在GitHub上克隆了我的項目,運行捆綁安裝並啟動了本地服務器,得到以下消息:
ActiveRecord::ConnectionNotEstablished
谷歌搜索后,我手動創建了一個database.yml文件並輸入以下信息:
# SQLite version 3.x
# gem install sqlite3-ruby (not necessary on OS X Leopard)
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
並運行rake db:create和rake db:migrate,但是我仍然收到錯誤消息,有人可以建議嗎?
順便說一句,這是我的Gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.14'
gem 'jquery-rails', '2.0.2'
gem 'bootstrap-sass', '2.1'
gem 'bcrypt-ruby', '3.0.1'
gem 'faker', '1.0.1'
gem 'will_paginate', '3.0.3'
gem 'bootstrap-will_paginate', '0.0.6'
group :development, :test do
gem 'sqlite3', '1.3.5'
gem 'rspec-rails', '2.11.0'
gem 'guard-rspec', '1.2.1'
gem 'guard-spork', '1.2.0'
gem 'childprocess', '0.3.6'
gem 'spork', '0.9.2'
end
group :test do
gem 'capybara', '1.1.2'
gem 'rb-fchange', '0.0.5'
gem 'rb-notifu', '0.0.4'
gem 'win32console', '1.3.0'
gem 'factory_girl_rails', '4.1.0'
gem 'cucumber-rails', '1.2.1', :require => false
gem 'database_cleaner', '0.7.0'
end
group :development do
gem 'annotate', '2.5.0'
end
group :production do
gem 'pg', '0.12.2'
end
group :assets do
gem 'sass-rails', '3.2.5'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
運行數據庫遷移:
# from command line
rake db:migrate
然后,如果有db/seeds.db
文件,則可以使用它來播種數據庫:
rake db:seed
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.