2011-09-02 53 views
2

我跟随chapter 2 of ruby.railstutorial.org并且无法连接到Rails 3.1上的数据库。将Rails 3.0.9迁移到Rails 3.1的问题? ActiveRecord :: ConnectionNotEstablished

我的猜测是Gemfile中的一些宝石缺失。

我试过使用提供的Gemfile(无效,localhost甚至不到服务器)和默认的。默认一个得到我:

enter image description here

我如何设置这个Gemfile中正确地为Rails 3.1?

+1

已安装的sqlite3并正常运行更新Gemfile.lock? – JW8

+0

@JW:不是,我运行gem install activerecord-sqlite3-adapter并得到这个:在任何版本库中找不到有效的gem'activerecord-sqlite3-adapter'(> = 0) – andandandand

+1

我解决了更改问题版本的Gemfile到sqlite 1.3.4 :) – andandandand

回答

3

它也发生在我身上。确保你正在运行最新的sqlite3 gem。

在你Gemfile,放松依赖性~> 1.3.0,然后通过运行

$ bundle update sqlite3