Run a simple Ruby app! Just using WEBrick, no dependencies! Ruby standard library only!
$ ruby app.rb
Install the Google Cloud SDK.
See the Ruby App Engine Quickstart or Ruby Flex docs for more.
$ gcloud app deploy
If you want to SSH into the container, just cuz...
Follow the documented steps for Debugging an Instance:
To SSH into a container, the following steps can all be run via gcloud
... but, via the UI:
Notice that, by default, ruby
is not in the PATH.
To see how this is confired by a running session, look at the base Dockerfile for the Ruby Runtime
Notice that we use rbenv and (1) setup RBENV_ROOT (2) add the rbenv bin and shims to PATH
Once that's done, you can use Ruby as usual!
See DEFAULT_RUBY_VERSION in the Dockerfile for the current default version used by the container. If your application has a .ruby-version
file, that will be the version used. If you run your Ruby commands from your application directory /app
then .ruby-version will be automatically used to choose your Ruby version appropriately.
Thanks @remi, these instructions worked perfectly and the environment allowed me to run acceptance tests for google-cloud-ruby! Much appreciated!