Put your app online with anynines
Created by Floor Drees, @floordrees
COACH: Talk about the benefits of deploying to anynines vs utilising US data centers.
Get yourself some anynines
Download and install the Command Line Interface to interact with anynines.
Now select the anynines api endpoint as target and authenticate using your user credentials:
Or if that doesn’t work for you, use:
… which will prompt you for your email address and password.
Wonder what that
cf stands for? It’s short for Cloud Foundry, a system anynines is using behind the scenes.
Push your app online
Let’s push this source code from your local machine to anynines:
This will fail miserably since the example application needs a MySQL database to start. So, lets create one! The command below will create a MySQl service with a free service plan. After the plan name you have to specify a name for the service instance. This name will be used for further commands to refer to this service instance:
$> cf create-service mysql Pluto-free [service-name-you-can-choose]
(Really, you can use any name. Make it count!)
Next, binding the MySQL service instance to the application, to grant the application access to the MySQL instance, type:
Finally we have to restart the application to make sure the service binding takes effect:
You will see this:
Push successful! App 'railsgirls' available at railsgirls.de.a9sapp.eu. Score!
We need to add our new code to version control. You can do this by running the following in the terminal:
COACH: This would be a great time to talk about version control systems and git, if you haven’t already.
You can check all available cf sub-commands by typing
In case your terminal does not have all the answers, the anynines team probably does. Just shoot them a mail at firstname.lastname@example.org.
- Handy cheatsheet for Ruby, Rails, console etc.
- Guide 1: Guide to install Rails
- Guide 2: Build Your First App
- Guide 3: Push Your App to GitHub
- Guide 4: Put your app online with…
- Guide 5: Allow Comments on Your App
- Guide 6: Add design using HTML & CSS
- Guide 7: Create thumbnails with Carrierwave
- Guide 8: Add Authentication (user accounts) with Devise
- Guide 9: Add Profile Pics with Gravatar
- Guide 10: Improve your design with HTML and CSS
- Guide 11: Continuous Deployment
- Guide 12: Build a voting app in Sinatra
- Guide 13: Build a diary app in Ruby on Rails
- Guide 14: Add a back-end to your app (admin pages)
- Guide 15: Go through additional explanations for the App