Frédéric Champreux
2012-May-29 15:49 UTC
[rspec-users] RSpec fails testing on ActiveRecord
Hi, I''m new to RoR, and following the RoR 3.2 Tutorial from Michael Hartl. When it comes to execute testing (chap. 3.2.1), RSpec returns a hundred of errors starting with this one (and all looking the same more or less): /home/fred/.rvm/gems/ruby-1.9.3-p0 at ODQ/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:45:in `resolve_hash_connection'': database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified) My DEV database is PostgreSQL and looks to work fine. Can some help me to understand what''s wrong and solve it ? Thanks. Attachments: http://www.ruby-forum.com/attachment/7447/Gemfile http://www.ruby-forum.com/attachment/7448/database.yml http://www.ruby-forum.com/attachment/7449/Ruby_on_Rails__Welcome_aboard.html -- Posted via http://www.ruby-forum.com/.
Is there a ''database.yml'' config file in your app? It should be under "<your app folder>/config" folder. In that, you need to specify the adapter. As per the logs, looks like the adapter is not specified or else the config file is not loaded into the app in runtime. -- Kashyap KMBC On Tuesday 29 May 2012 at 9:19 PM, Fr?d?ric Champreux wrote:> Hi, > > I''m new to RoR, and following the RoR 3.2 Tutorial from Michael Hartl. > > When it comes to execute testing (chap. 3.2.1), RSpec returns a hundred > of errors starting with this one (and all looking the same more or > less): > > /home/fred/.rvm/gems/ruby-1.9.3-p0 at ODQ/gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:45:in > `resolve_hash_connection'': database configuration does not specify > adapter (ActiveRecord::AdapterNotSpecified) > > My DEV database is PostgreSQL and looks to work fine. > > Can some help me to understand what''s wrong and solve it ? > > Thanks. > > Attachments: > http://www.ruby-forum.com/attachment/7447/Gemfile > http://www.ruby-forum.com/attachment/7448/database.yml > http://www.ruby-forum.com/attachment/7449/Ruby_on_Rails__Welcome_aboard.html > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org (mailto:rspec-users at rubyforge.org) > http://rubyforge.org/mailman/listinfo/rspec-users > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120529/8ac4d9ba/attachment.html>
You''ll need to create a test database in postgres, and then modify your database.yml file to reference it. # PostgreSQL 8.4 development: adapter: postgresql encoding: unicode database: ODQ_APP pool: 5 test: adapter: postgresql encoding: unicode database: ODQ_APP_TEST pool: 5 Todd Sedano Director of Software Engineering Carnegie Mellon University Silicon Valley Campus Developing Software Leaders (TM) T: 650-335-2812 On Tue, May 29, 2012 at 8:49 AM, Fr?d?ric Champreux <lists at ruby-forum.com>wrote:> Hi, > > I''m new to RoR, and following the RoR 3.2 Tutorial from Michael Hartl. > > When it comes to execute testing (chap. 3.2.1), RSpec returns a hundred > of errors starting with this one (and all looking the same more or > less): > > /home/fred/.rvm/gems/ruby-1.9.3-p0 at ODQ > /gems/activerecord-3.2.1/lib/active_record/connection_adapters/abstract/connection_specification.rb:45:in > `resolve_hash_connection'': database configuration does not specify > adapter (ActiveRecord::AdapterNotSpecified) > > My DEV database is PostgreSQL and looks to work fine. > > Can some help me to understand what''s wrong and solve it ? > > Thanks. > > Attachments: > http://www.ruby-forum.com/attachment/7447/Gemfile > http://www.ruby-forum.com/attachment/7448/database.yml > > http://www.ruby-forum.com/attachment/7449/Ruby_on_Rails__Welcome_aboard.html > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120529/ac1c7761/attachment-0001.html>