GoogleCloudPlatform / appengine-ruby

Optional integration library for the Ruby runtime for Google App Engine
Apache License 2.0
53 stars 21 forks source link

Can't run : bundle exec rake appengine:exec -- bundle exec rake db:migrate #6

Closed hafidhassin1 closed 7 years ago

hafidhassin1 commented 7 years ago

Hi,

I deployed a rails app on Google App Engine successfully, and I created a new Cloud Sql Postgres instance.

I have an issue when I trying to run database migration using this command : "bundle exec rake appengine:exec -- bundle exec rake db:migrate".

Error returned : rake aborted! Don't know how to build task 'appengine:exec' (see --tasks)

When I check appengine gem directory I can't find tasks.rb and exec.rb files.

How can I resolve that ?

vaughankg commented 7 years ago

@hafidhassin1 It's probably a dependency issue. Check the version of the gem. The latest is 0.4.1

aim-up commented 7 years ago

I ran a migration a few days ago, but now I'm getting the Don't know how to build error too. Running rake --tasks shows no appengine:exec task Adding require 'appengine/tasks' to Rakefile per docs produces this error: LoadError: cannot load such file -- appengine/tasks Tested with appengine gem versions 0.4.1 and 0.3.0

This can't really be the only way to migrate the database on GAE. Cloud Shell?

dazuma commented 7 years ago

It looks like the file permissions on version 0.4.1 were incorrect. Ruby files were being installed with 0640 instead of 0644 permissions. That might explain why those files couldn't be loaded in some circumstances.

I pushed version 0.4.2 with fixed file permissions. Please try those and see if it fixes your issues. Sorry for the screw-up.

Regarding other ways to do database migrations, yes it may be possible to use Cloud Shell. You would have to start the Cloud SQL Proxy yourself, but I think it's doable. Feel free to contact me directly if you're trying this approach and need help.

/cc @hafidhassin1 @protolif

aim-up commented 7 years ago

Upgrading to version 0.4.2 did the trick. Thank you @dazuma.