Showing posts with label heroku. Show all posts
Showing posts with label heroku. Show all posts

Sunday, July 24, 2011

More Heroku Rails Deployment Issues

I've (partially) fixed my issues with deploying to Heroku. The solution was to specify rake version 0.8.7, as noted all over Stack Overflow for people who had the same error I was getting. I could have fixed this issue earlier, if I'd realized you deploy to Heroku from Git, not from your local machine. So I was updating my code, then trying to migrate the database on Heroku and I kept getting the same error because the code hadn't been changed on Git. Still, progress!

But I'm still having a problem. Take a look at the deployed version of my Depot application:


And here's a screenshot of how it looks on my machine:


Heroku is not displaying the product listing and I can't figure out why. The database information is stored in a seed file, so I thought a heroku rake db:seed command would populate the data and fix my issue, but no such luck. I've also noticed that the new action for my Product model throws an error on Heroku, but it works on my local version. Any ideas what's going on here?

Here's a link to my git repository for this application:

Saturday, July 23, 2011

Uninitialized Constant Rake::DSL and Heroku

I took @jqr's advice and signed up for Heroku this morning. Agile Web Development had me working on running a virtual name server with Apache and it was way too complicated for my tastes. Apparently coders who don't want to deal with server-side headaches are pretty common, hence Heroku!

But I've hit a snag. I get an uninitialized constant Rake::DSL error whenever I try to run a migration on Heroku. Here's the full error:

gozer /users/tylermoore/code/depot master$ heroku rake db:migrate
(in /app)
rake aborted!
uninitialized constant Rake::DSL
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2482:in `const_missing'
/app/Rakefile:6:in `'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `load'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2373:in `raw_load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2007:in `block in load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2058:in `standard_exception_handling'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:2006:in `load_rakefile'
/usr/ruby1.9.2/lib/ruby/1.9.1/rake.rb:1991:in `run'
/usr/ruby1.9.2/bin/rake:31:in `

'


Apparently, this is a well-documented error, and I've dug through a ton of Stack Overflow and Google discussion threads, trying various solutions but no luck so far.

I've manually set my rake gem to version 0.8.7, updated my GemFile and pushed changes to Git, which works for a lot of people, but not for me. Still, I'm not discouraged. I'll figure this out eventually. Just thought I'd throw this up here in case someone has had this exact error and found another solution.