This repository shows how to run a Ruby on Rails application in DevSpaces.
- Ruby on Rails
- MySQL
- Create an account
- Install client application
- Clone the repository to your local machine
git clone https://github.com/devfactory/ruby-on-rails-mysql.git
- Navigate to devspace directory
cd ruby-on-rails-mysql/devspace
- Run
devspaces create
command. This command opens a build status window and shows you the progress of DevSpace creation. Once build is completed, validated starts. - Once validation is completed. Run
devspaces ls
command to see the list of DevSpaces, and it's status. Newly created DevSpaceruby-demo
is in "Stopped" status. - To start your DevSpace run following command
devspaces start ruby-demo
. You receive a notification when your DevSpace is ready to be used. - After the DevSpace is running, go back to repository root
cd ..
. Then rundevspaces bind ruby-demo
command to synch source code from your local machine to the DevSpace. - After synching completes, connect to your DevSpace using
devspaces exec ruby-demo
command from your terminal. - Now you're inside your DevSpace terminal. To start the application, run startup script
./start.sh
Once this application is running inside DevSpace, to access the application from your local machine run following command from your local terminal devspaces info ruby-demo
. URL under URLs section mapped to port 3000
is the public URL to your running application. Append /dogs
to this URL to see it is working e.g. http://ruby-demo.<username>.devspaces.io:<port>/dogs
Code-Server project allows you to run Visual Studio Code on remote server and access it via a browser. Configurations in devspace/code-server
folder show how we can convert the same project to use Code-Server as IDE.
- Clone the repository to your local machine
git clone https://github.com/devfactory/ruby-on-rails-mysql.git
- Navigate to devspace directory
cd ruby-on-rails-mysql/devspace/code-server
- Run
devspaces create
command. This command opens a build status window and shows you the progress of DevSpace creation. Once build is completed, validated starts. - Once validation is completed. Run
devspaces ls
command to see the list of DevSpaces and corresponding status. Newly created DevSpaceruby-code-server-demo
will be in "Stopped" status. - To start your DevSpace run following command
devspaces start ruby-code-server-demo
. You receive a notification when your DevSpace is ready to be used. - After the DevSpace is running, go back to repository root
cd ../../
. Then rundevspaces bind ruby-code-server-demo
command to synch source code from your local machine to the DevSpace. - After synching completed, run
devspaces info ruby-code-server-demo
command to see the URLs exposed. - From the URLs section, find the URL corresponding to port
8443
and open it in your browser which shows VS code IDE for editing source code. - From "Terminal" menu, open a new terminal and run script
./start.sh
to start the application. This command starts the application in local port3000
- Go back to your local machine terminal and get the URL corresponding to port
3000
from thedevspaces info ruby-code-server-demo
result. Then open that URL in another browser tab to see the demo application.