DIVE INTO CODE

プロのエンジニアになるために挑戦する人が、チャンスをつかめる場をつくる。

Rails00_Codeanywhere_English

On the merits of using Codeanywhere and the work to be done today

merit

  • Installation work on the PC is unnecessary, you can work from any PC coupled to the Internet
  • because no credit card registration is required, anyone can use it

Work to do today

  • In order to use Codeanywhere as a development environment, you need to select and install OS, development language, database management system and tools yourself.
  • We will do the work we need to develop a Ruby on Rails application.

User registration with Codeanywhere

[Procedure] Access the Codeanywhere site (https://codeanywhere.com/) and click Sign Up

https://diveintocode.gyazo.com/e355c0245726c931706b2f4301b42163

If user registration is completed, please login.

User registration

[Procedure] Enter the e-mail address, check “I am not a robot” and click on Register

https://diveintocode.gyazo.com/ac04b7f7e234e66aaf2dd9f1cd49bfed

[Procedure] Confirm that the following screen is displayed (which means the account has been registered) and click here

Please click “here link” in the lower right.

https://diveintocode.gyazo.com/dd1e55f7c031ce324c284c7dd6649357

[Procedure] Confirm that the Editor screen is displayed

https://diveintocode.gyazo.com/443ebc637bfa0040249dd10f177afd12

Initial setting

Create a Container

[Procedure] Check the Connection Wizard screen

On this screen you can set what OS and development language are to be installed.

https://diveintocode.gyazo.com/0a8f5d6f0fde195f42babc23222dae32

[Procedure] Enter “code” in “Name” and “ruby” in search field, select Ruby Ubuntu from the displayed bottom field, and click “create”

https://diveintocode.gyazo.com/438d2efcbe8e2197f5e7a834e8bb6489

[Procedure] Wait for a while until processing is completed

https://diveintocode.gyazo.com/2e075c96720d9631362e8efe9fc2d3a1

It is completed if it comes to this screen.

https://diveintocode.gyazo.com/38b185480b1c85540acc524e3a8c2f05
At this point, Ubuntu as the OS, Ruby as the development language, Ruby on Rails as the Web application framework are installed in the container (computer) in Codeanywhere.

IDE screen confirmation

Check the screen structure of Codeanywhere

[Procedure] Roughly check the screen

https://diveintocode.gyazo.com/38b185480b1c85540acc524e3a8c2f05

Left pane: Folder structure (located in Codeanywhere). Middle pane: You can execute commands and edit files here.
The URL displayed on this screen will be used later. Be careful not to accidentally close this file.

Display terminal

[Procedure] Select the tab “code” on the left side

https://diveintocode.gyazo.com/a54ad6e80bcdb07356c5405653d2c9bb

If “~ / workspace $” is displayed, you can execute commands.
Input the command statement to the computer with the character strings here and proceed with the development work.

Install PostgreSQL and Heroku Toolbelt

[Procedure] Execute command to upgrade package management system

Update the package management system to the latest version before installing PostgreSQL or Heroku Toolbelt. This is because the package management system manages the tools to be installed and they may not be installed correctly unless it is the latest version.

sudo apt-get update

https://diveintocode.gyazo.com/a81f5083b6aca9c0aad6aa83257a83b6

[Procedure] Wait for a while until processing is completed

https://diveintocode.gyazo.com/c5d16d1b79c2ab582306c159dc1f872d

If “~ / workspace $” is displayed, processing is completed and the next command can be executed.

Install PostgreSQL

sudo apt-get install libpq-dev postgresql

https://diveintocode.gyazo.com/b3930e1e5e47c39f990c3ee78b0283c3

[Procedure] When [Y/n] is displayed, enter Y and press the enter key

Y

It makes processing proceeds.

https://diveintocode.gyazo.com/89b1241c62817b980c4be680a081a6ed

[Procedure] Wait for a while until processing is completed

https://diveintocode.gyazo.com/2ea3fd2dc30932e4be0bb193bcd50a2c

If “~ / workspace $” is displayed, processing is completed and the next command can be executed.

[Procedure] Set to PostgreSQL execution mode

Switch the mode to initialize PostgreSQL.

sudo su postgres -c psql

https://diveintocode.gyazo.com/9d5ad36a9f45c9a2b5d66632de00deb2

[Procedure] Create a PostgreSQL user for automatic access to PostgreSQL

When being connected from a Rails application, PostgreSQL connects with the PostgreSQL user name which is same as the OS user of that computer. Therefore, you should create a PostgreSQL user with the same name as the OS user name displayed in the terminal “cabox” now.

CREATE ROLE cabox SUPERUSER LOGIN PASSWORD 'diveintocode';

https://diveintocode.gyazo.com/3df8bca1d066af32c3d9ebc31f7caa8d

[Procedure] Exit from PostgreSQL mode

You can quit by typing backslash and q.

\q

Install Heroku Toolbelt

[Procedure] Execute the command to install Heroku Toolbelt

sudo wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh

https://diveintocode.gyazo.com/51e89a2ceb677b00eee996a99b51cbc5

[Procedure] Wait for a while until processing is completed

https://diveintocode.gyazo.com/9c793e32a8371497b7baccc6b42547fc

If “~ / workspace $” is displayed, processing is completed and the next command can be executed.

Notes on development work

  • `refresh’ display the folders and files in the left pane every time you create a file.
  • If you want to display a new terminal, code → right click → SSH Terminal
  • The operation confirmation of the developed Rails application is displayed on the initial screen

Refresh every time you create a file

[Procedure] Place the mouse cursor on “code” in the left pane and do right click when Refreshing

https://diveintocode.gyazo.com/a72587da7abbb93ee85b0bbf619178cf

Display a new terminal

[Procedure] Place the mouse cursor on “code” in the left pane and right click → SSH Terminal

https://diveintocode.gyazo.com/7b83d21307578e4eb01804bf848bbaae

Check operation of Rails application

[Procedure] Click the URL link of HTTPS described in the code Container file

It is written in the file from the beginning as “to access your application over HTTPS, make sure your application is running on port 3000 and use the following link:”. Since it is troublesome to search later, please write down so that you can trace it even if you accidentally close the file .

https://diveintocode.gyazo.com/24a4d756c45d3a2278c75f707a16e84d

※When you are not running the Rails application, the following Codeanywhere standard screen is displayed.

https://diveintocode.gyazo.com/f776cb7d0392d200df04208328b1d277

To the next step

Development of trial application for CodeAnywhere version

カウンセリングを開催中

プロのエンジニアになるために挑戦する人を応援します.

カウンセリングはこちら