我已经使用'install bundle'生成了一个应用程序,并且在欢迎登机应用程序的“关于您的应用程序的环境”页面中获取了错误ActiveRecord :: ConnectionNotEstablished。RoR - ActiveRecord :: ConnectionNotEstablished
的Gemfile中
source 'https://rubygems.org'
gem 'rails', '3.2.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3-ruby', '1.2.5', :require => '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'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
什么想法?
- 这是生成的Gemfile +更改轨道&的sqlite-红宝石的版本号通过排除法筛选,获得所述捆绑安装的一切。
一些背景
- 我要通过一本书,所以不同版本的建议都很好。
- 我不知道我在做什么。
- 我使用OSX 10.5(豹)
让我知道如果有什么我应该补充更多的信息。奖金问题:如果我需要从头开始使用不同的sqlite版本,我应该创建一个新的应用程序还是可以再次使用Bundler?
编辑 克莱伯S.曾建议配置配置您的config/database.yml
文件的文件看起来像:
# SQLite version 3.x
# gem install sqlite3
#
# Ensure the SQLite 3 gem is defined in your Gemfile
# gem 'sqlite3'
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
任何想法有什么不对?
如果你改变你的Gemfile,首先尝试运行'bundle install',如果一个特定的gem版本被锁定,它会要求你运行'bundle update * somegem *' – 2012-02-12 17:20:11
谢谢。 要清楚,运行软件包更新不仅仅是添加宝石? – ntc 2012-02-12 17:31:38
'捆绑更新'本身去寻找所有宝石的最新版本。 – 2012-02-14 16:24:14