I am getting the following error when trying to run throught the cookbook tutorial on ONLamp. There are also other OSX 10.4.2 users with the same issue. Im not sure if its related, but I am hoping someone can help. Here is the error and my database.yml ActiveRecord::StatementInvalid in Recipe#index No database selected: SELECT COUNT(*) FROM recipes script/server:49 Show framework trace /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:462:in `log'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:121:in `execute'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:230:in `select'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:101:in `select_one'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:461:in `count_by_sql'' /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:454:in `count'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:154:in `count_collection_for_pagination'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:171:in `paginator_and_collection_for'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:111:in `paginate'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:101:in `list'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:94:in `index'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in `perform_action_without_filters'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in `perform_action_without_benchmark'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `measure'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in `perform_action_without_rescue'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in `perform_action'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `send'' /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in `process'' /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in `handle_dispatch'' /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in `service'' /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' /usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in `dispatch'' ===== herb:~/cookbook sean$ cd config/ herb:~/cookbook/config sean$ cat database.yml development: adapter: mysql database: cookbook host: localhost username: root password: 923 # 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: mysql database: cookbook host: localhost username: root password: 923 production: adapter: mysql database: cookbook host: localhost username: root password: 923 herb:~/cookbook/config sean$
On 10/2/05, Sean Carey <sean.carey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am getting the following error when trying to run throught the > cookbook tutorial on ONLamp. There are also other OSX 10.4.2 users > with the same issue. Im not sure if its related, but I am hoping > someone can help. Here is the error and my database.yml > > > > ActiveRecord::StatementInvalid in Recipe#index > > No database selected: SELECT COUNT(*) FROM recipes > script/server:49 > > > Show framework trace > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:462:in > `log'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:121:in > `execute'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:230:in > `select'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:101:in > `select_one'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:461:in > `count_by_sql'' > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:454:in > `count'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:154:in > `count_collection_for_pagination'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:171:in > `paginator_and_collection_for'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:111:in > `paginate'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:101:in > `list'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:94:in > `index'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in > `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in > `perform_action_without_filters'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in > `perform_action_without_benchmark'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > `measure'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > `perform_action_without_rescue'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in > `perform_action'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in > `send'' > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in > `process'' > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in > `handle_dispatch'' > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in `service'' > /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > /usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' > /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' > /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in `dispatch'' > > > > =====> > herb:~/cookbook sean$ cd config/ > herb:~/cookbook/config sean$ cat database.yml > development: > adapter: mysql > database: cookbook > host: localhost > username: root > password: 923 > > # 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: mysql > database: cookbook > host: localhost > username: root > password: 923 > > production: > adapter: mysql > database: cookbook > host: localhost > username: root > password: 923 > herb:~/cookbook/config sean$The version of ruby that comes with OS X is borked. You should probably get another copy of Ruby (look into Locomotive). And you might also need a new(er) release of ruby-mysql.
I used GEMS to install ruby. Would there still be issues installing it with GEMS? herb:~ sean$ which ruby /usr/bin/ruby herb:~ sean$ ruby --version ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] thanks Sean On 10/2/05, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 10/2/05, Sean Carey <sean.carey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I am getting the following error when trying to run throught the > > cookbook tutorial on ONLamp. There are also other OSX 10.4.2 users > > with the same issue. Im not sure if its related, but I am hoping > > someone can help. Here is the error and my database.yml > > > > > > > > ActiveRecord::StatementInvalid in Recipe#index > > > > No database selected: SELECT COUNT(*) FROM recipes > > script/server:49 > > > > > > Show framework trace > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:462:in > > `log'' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:121:in > > `execute'' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:230:in > > `select'' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:101:in > > `select_one'' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:461:in > > `count_by_sql'' > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:454:in > > `count'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:154:in > > `count_collection_for_pagination'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:171:in > > `paginator_and_collection_for'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:111:in > > `paginate'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:101:in > > `list'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:94:in > > `index'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in > > `send'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in > > `perform_action_without_filters'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in > > `perform_action_without_benchmark'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > > `perform_action_without_rescue'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > > `measure'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > > `perform_action_without_rescue'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in > > `perform_action'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in > > `send'' > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in > > `process'' > > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' > > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in > > `handle_dispatch'' > > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in `service'' > > /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > > /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > > /usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' > > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' > > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' > > /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' > > /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' > > /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' > > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in `dispatch'' > > > > > > > > =====> > > > herb:~/cookbook sean$ cd config/ > > herb:~/cookbook/config sean$ cat database.yml > > development: > > adapter: mysql > > database: cookbook > > host: localhost > > username: root > > password: 923 > > > > # 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: mysql > > database: cookbook > > host: localhost > > username: root > > password: 923 > > > > production: > > adapter: mysql > > database: cookbook > > host: localhost > > username: root > > password: 923 > > herb:~/cookbook/config sean$ > > The version of ruby that comes with OS X is borked. You should > probably get another copy of Ruby (look into Locomotive). And you > might also need a new(er) release of ruby-mysql. >-- Sean Carey
I just downloaded and installed locomotive, selected my cookbook app. Changed it over, and it worked like a charm. Thanks Sean On 10/2/05, Sean Carey <sean.carey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I used GEMS to install ruby. Would there still be issues installing it > with GEMS? > > herb:~ sean$ which ruby > /usr/bin/ruby > herb:~ sean$ ruby --version > ruby 1.8.2 (2004-12-25) [powerpc-darwin8.0] > > > > thanks > > Sean > > On 10/2/05, Joe Van Dyk <joevandyk-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 10/2/05, Sean Carey <sean.carey-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I am getting the following error when trying to run throught the > > > cookbook tutorial on ONLamp. There are also other OSX 10.4.2 users > > > with the same issue. Im not sure if its related, but I am hoping > > > someone can help. Here is the error and my database.yml > > > > > > > > > > > > ActiveRecord::StatementInvalid in Recipe#index > > > > > > No database selected: SELECT COUNT(*) FROM recipes > > > script/server:49 > > > > > > > > > Show framework trace > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/abstract_adapter.rb:462:in > > > `log'' > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:121:in > > > `execute'' > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:230:in > > > `select'' > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/connection_adapters/mysql_adapter.rb:101:in > > > `select_one'' > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:461:in > > > `count_by_sql'' > > > /usr/lib/ruby/gems/1.8/gems/activerecord-1.11.1/lib/active_record/base.rb:454:in > > > `count'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:154:in > > > `count_collection_for_pagination'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:171:in > > > `paginator_and_collection_for'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/pagination.rb:111:in > > > `paginate'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:101:in > > > `list'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/scaffolding.rb:94:in > > > `index'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in > > > `send'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:756:in > > > `perform_action_without_filters'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/filters.rb:295:in > > > `perform_action_without_benchmark'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > > > `perform_action_without_rescue'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > > > `measure'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/benchmarking.rb:41:in > > > `perform_action_without_rescue'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/rescue.rb:80:in > > > `perform_action'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in > > > `send'' > > > /usr/lib/ruby/gems/1.8/gems/actionpack-1.9.1/lib/action_controller/base.rb:356:in > > > `process'' > > > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/dispatcher.rb:32:in `dispatch'' > > > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:105:in > > > `handle_dispatch'' > > > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:71:in `service'' > > > /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'' > > > /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'' > > > /usr/lib/ruby/1.8/webrick/server.rb:155:in `start_thread'' > > > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start'' > > > /usr/lib/ruby/1.8/webrick/server.rb:144:in `start_thread'' > > > /usr/lib/ruby/1.8/webrick/server.rb:94:in `start'' > > > /usr/lib/ruby/1.8/webrick/server.rb:89:in `each'' > > > /usr/lib/ruby/1.8/webrick/server.rb:89:in `start'' > > > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > > > /usr/lib/ruby/1.8/webrick/server.rb:79:in `start'' > > > /usr/lib/ruby/gems/1.8/gems/rails-0.13.1/lib/webrick_server.rb:57:in `dispatch'' > > > > > > > > > > > > =====> > > > > > herb:~/cookbook sean$ cd config/ > > > herb:~/cookbook/config sean$ cat database.yml > > > development: > > > adapter: mysql > > > database: cookbook > > > host: localhost > > > username: root > > > password: 923 > > > > > > # 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: mysql > > > database: cookbook > > > host: localhost > > > username: root > > > password: 923 > > > > > > production: > > > adapter: mysql > > > database: cookbook > > > host: localhost > > > username: root > > > password: 923 > > > herb:~/cookbook/config sean$ > > > > The version of ruby that comes with OS X is borked. You should > > probably get another copy of Ruby (look into Locomotive). And you > > might also need a new(er) release of ruby-mysql. > > > > > -- > > Sean Carey >-- Sean Carey