Develop your app on the cloud with the Nitrous.io web IDE

Seeing how running Rails on Windows is not everybody's cup of tea, here's a quick guide on how to run your app on Nitrous.io, a cloud development box that you can access from wherever you have a browser. Yes, even Chrome OS.

This guide uses a Ruby on Rails app as an example, but Nitrous.io supports NodeJS, Python/Django, Go, PHP and Meteor apps out of the box.
  • Signup on Nitrous.io with GitHub to make this easier later on.
  • Create a box for your Rails app, pick a nice name for it:

  • I suposse you're doing some top-secret cool stuff. so click on your newly created box, then on "Reveal public key", and add the key to your GitHub account so you can clone your private repo:


  • To use the latest Ruby version, we need to install it with ruby_install. Open your box, and on the terminal, run:
  • parts install ruby_install
    ruby-install ruby 2.2.0
    chruby ruby-2.2.0
    gem install bundle
    
  • Clone your app with git clone git@github.com:user/repo.git, run bundle to install the gems. Code is up and running now!
  • Now, the database. Since Nitrous.io gives us no local one, let's set it up on Heroku. Follow this guide, get confused on the "Heroku Postgres Connection Settings" since Heroku's interface doesn't look like that anymore, and then write the following configuration on your config/database.yml, using the values of the database your just created:
  • development:
      adapter: postgresql
      encoding: utf8
      database: # Database
      user: # User
      password: # Password
      host: "ec2-10-17.compute-1.amazonaws.com" # URL from "@" to ".com"
      pool: 5
      port: 5432
    
  • Run rake:db:setup to kickstart your DB.
  • Finally, run bundle exec rails server -b 0.0.0.0 to start up your server, and access it through the Preview -> Port 3000 option on the menu bar.
  • Rejoice in your fancy cloud development environment!

No comments:

Post a Comment