views:

34

answers:

2

I'm using Texticle to do full-text search on Heroku. It's working great.

I'm now trying to setup nightly db backups to Amazon s3 using this script.

When I try heroku rake backups:backup I first get this error:

/disk1/home/slugs/245176_566b3d9_4845/mnt/.bundle/gems/bundler/gems/texticle-3a96c70a9fa60921197f0027204a23824435b142-ee972fc2f8f84e6faf323a9a5580dca475ea98d9/lib/texticle.rb:52: warning: already initialized constant VERSION

From that point it goes ahead and runs the rest of the rake task:

backup started @ Fri Jul 30 02:30:00 -0700 2010
dumping sql file..
gzipping sql file...
uploading my-app_20100730023000.sql.gz to S3...

But looking in S3 shows that it didn't actually upload anything.

Looks like texticle's VERSION constant is interfering with the amazon gem. I've also tried to use the right_aws gem but I get the exact same error.

Anyone have any suggestions on how to get this going?

+1  A: 

That warning is fairly common due to people not handling namespacing correctly. Generally it is harmless.

I'd look for other reasons your S3 upload is not working. Are the credentials correct? Does the bucket you're trying to upload to exist?

David Dollar
Hey David, as it turns out, you're right about it being harmless. My creds where correct and the rake task I was using would create the bucket if it didn't exist. BUT, I did figure out what was going on. Check the answer below...
erskingardner
A: 

So the problem was actually in the fact that I wasn't specifying the :require => 'aws/s3' after declaring the gem in the Gemfile. It's working fine now. Strange though is that now I've switched to the right_aws gem and the problem (which used to affect that gem as well) seems to have gone away even though you don't have to specify the :require with right_aws. Anyone have ideas on that?

erskingardner
If the gem name is the same as the require string, you don't have to specify :require
David Dollar