06 Sep 2008, 09:07
Generic-user-small

Neil Cauldwell (1 post)

I bought the latest episode on the day it was released and really enjoyed it. I’ve just started implementing the techniques in a current project, but, my setup seems to be having some problems running the Populator gem. When I run the rake db:populate, I see the following error (the gem is installed);


rake aborted!
Could not find RubyGem echoe (>= 0)

This happens in any Rails environment, on my own app, and on the cinemas app code I downloaded. I haven’t noticed issues with any other gems yet. The only issues I could possibly relate to it are;

1. I recently updated my RubyGems—system (although no other problems since)
2. script/dbconsole has issues with the mysql setup;

 
Neil$ script/dbconsole
Couldn't find database client: mysql5, mysql. Check your $PATH and try
again. 

...and I just followed an instruction on the Hivelogic MySQL installation – it seems as though Rails can, at least, find the path to mysql, but it still won’t load dbconsole;


Neil$ script/dbconsole
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

MySql has been running ok despite this (except it seems to have been swapping foreign_keys from INT to BIGINT on this project – but not all my apps) and I can run all usual DB related rake/script commands without any issues (and the database.yml file is using passwords and the correct user name for mysql).

I don’t know if either of those are related but, maybe they’ll help in the troubleshooting. Any ideas?

09 Sep 2008, 18:15
Ryan_bates_cropped_pragsmall

Ryan Bates (60 posts)

This was a problem with my populator gem. Echoe isn’t supposed to be a gem dependency, but looks like something is hosed in my gem config. I think I fixed it, so the latest populator version (0.2.4) should work without echoe installed.

The mysql problem is unrelated. It looks like the root MySQL user has a password. You’ll need to set that password in your config/database.yml file. Hopefully that will solve your problem.

12 Sep 2008, 09:54
Generic-user-small

Joe Chesak (2 posts)

Ryan,

I am using a clean drop of the code for Episode 5, and I am also experiencing an error with that gem. Is this actually a problem with the ‘Showing’ model? ...

/cinemas> rake db:populate RAILS_ENV=staging
(in /Users/joe/cinemas)
rake aborted!
undefined method `starts_on=’ for #

(See full trace by running task with—trace)
/cinemas> rake db:populate RAILS_ENV=staging—trace
(in /Users/joe/cinemas)
  • Invoke db:populate (first_time)
  • Invoke environment (first_time)
  • Execute environment
  • Execute db:populate
    rake aborted!
    undefined method `starts_on=’ for #
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/record.rb:57:in `method_missing’
    /Users/joe/cinemas/lib/tasks/populate.rake:28
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:53:in `call’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:53:in `build_records’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:50:in `times’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:50:in `build_records’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:43:in `populate’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:29:in `remember_depth’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:42:in `populate’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/model_additions.rb:25:in `populate’
    /Users/joe/cinemas/lib/tasks/populate.rake:25
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:53:in `call’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:53:in `build_records’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:50:in `times’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:50:in `build_records’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:43:in `populate’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:29:in `remember_depth’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/factory.rb:42:in `populate’
    /Library/Ruby/Gems/1.8/gems/populator-0.2.4/lib/populator/model_additions.rb:25:in `populate’
    /Users/joe/cinemas/lib/tasks/populate.rake:22
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `call’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:546:in `execute’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `each’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:541:in `execute’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:508:in `invoke_with_call_chain’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `synchronize’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:501:in `invoke_with_call_chain’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:494:in `invoke’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1931:in `invoke_task’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `each’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1909:in `top_level’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1903:in `top_level’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1881:in `run’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1948:in `standard_exception_handling’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/lib/rake.rb:1878:in `run’
    /Library/Ruby/Gems/1.8/gems/rake-0.8.1/bin/rake:31
    /usr/bin/rake:19:in `load’
    /usr/bin/rake:19
    ~/cinemas>
12 Sep 2008, 14:51
Ryan_bates_cropped_pragsmall

Ryan Bates (60 posts)

Oops, seems there’s a problem in the code. Thanks for finding that. I’ve sent in an update so it should be fixed soon. In the meantime you just need to change starts_at and ends_at in the showings migration to starts_on and ends_on. Then run “rake db:migrate:reset” (which will recreate the table). Let me know if that doesn’t work.

13 Sep 2008, 20:03
Generic-user-small

Joe Chesak (2 posts)

Ryan,

That worked; all is well. Thanks!

I tweaked the migration as you described. After that, it helped to wipe out the database first and start fresh:

In MySQL:

DROP DATABASE cinemas_staging;
CREATE DATABASE cinemas_staging;

In cinemas/ directory:

rake db:migrate RAILS_ENV=staging
rake db:populate RAILS_ENV=staging
  You must be logged in to comment