Regarding overcapacity when setting Rails tutorial environment in Cloud 9

Purpose of the article

・ For your own memo Rails tutorials on Cloud9 Share your stumbling blocks with beginners

PC environment

macOS Catalina 10.15.7 MacBook Pro (13-inch, 2020, Two Thunderbolt 3 ports) Processor 1.4 GHz quad core Intel Core i5 Memory 8GB version CentOs version: 7 Ruby version: 2.7.2 (x86_64-linux) Rails version: 5.1.7

Article content

Where I stumbled while following the Rails tutorial

  1. Rail does not start
  2. Cloud9 shows that there is not enough space

Rails doesn't start

After completing the environment construction and trying to launch Rails on the local server, the following is displayed. If you look closely, it was mentioned in the tutorial, but when you click on the upper right, it started up safely in another browser. (Embarrassing ... lol) screencapture-us-east-2-console-aws-amazon-cloud9-ide-098b30f2bb7948a79a7dfa96aca72904-2020-12-19-17_22_17.png

Cloud9 shows that there is not enough space

When I tried to install heroku, the following message was displayed and the installation was not possible.

No space left on device 

Therefore, when I checked the capacity with the following command, I confirmed that the capacity was maxed out in/dev/xvda1.

ubuntu:~/environment/hello_app (master) $ df -h
Filesystem      Size  Used Avail Use% Mounted on
udev            476M     0  476M   0% /dev
tmpfs            98M  9.3M   89M  10% /run
/dev/xvda1      9.7G  9.7G     0 100% /

I updated the volume and snapshot by referring to the following article, but the above capacity overrun was not resolved ..

https://qiita.com/itotoma/items/d266df563367a0a14268

After all, by initializing Cloud9 and rebuilding it, the above problem was solved. (Mystery remains a mystery)

However, it seems that it may not work at worst if the capacity is exceeded, so If you are studying rails tutorial on Cloud9, it is a good idea to increase the capacity as soon as possible.

It's easy, but here's how to do it.

  1. Open the Amazon EC2 console
  2. Select the volume you want to change Select "Change Volume" from the "Action" button at the top and change the size from 10 to 30 (free max capacity is 30)
  3. Go to "Instance" and select "Instance Status"-> "Restart (Start if stopped)" from the "Action" button at the top of the screen. Go back to Cloud9 and expand the volume from the terminal
  4. Expand the capacity with the following command
$ sudo growpart /dev/xvda 1
$ lsblk
.
.
xvda 202:0 0 30G 0 disk
└─xvda1 202:1 0 30G 0 part /
  1. Finally, extend the file system with the following command
$ sudo resize2fs /dev/xvda1
$ df -h
Filesystem Size Used Avail Use% Mounted on
.
.
/dev/xvda1 30G 8.2G 21G 27% /

At the end

I'm sorry for the boring article, but thank you for reading to the end! I'm working on the rails tutorial, so I'm not sure about it again. I would like to make an article.

Recommended Posts

Regarding overcapacity when setting Rails tutorial environment in Cloud 9
rails tutorial About account activation in production environment
Rails6 (MySQL, Ubuntu environment, Cloud9)
[PAY.JP] About setting environment variables-Courage to delete when in trouble-
Exit code 1 occurs when Rails is stopped in Docker environment
[Rails] Session timeout setting in devise
Build an environment for Rails projects under Git management in Cloud9
What to do if Cloud9 is full in the Rails tutorial
When log data accumulates in Rails and the environment stops working
[Rails 6] Customize Bootstrap in Rails + Bootstrap 5.0.0-alpha environment
Setting project environment variables in intelliJ
Cloud IDE: Heroku couldn't be installed in the Ruby on Rails tutorial
[Cloud9] Yay! You ’re on Rails! Is not displayed in the rails tutorial
How to use MySQL in Rails tutorial
Show Better Errors in Rails + Docker environment
Rails server cannot be started in Cloud9
[Rails] Reset the database in the production environment
How to redirect to http-> https when SSL is enabled in Rails × Heroku environment
[Ruby on Rails] Solving the addiction when setting crontab using whenever in EC2
rails tutorial
rails tutorial
rails tutorial
rails tutorial
When nginx conf is not reflected well in AWS Elastic Beanstalk + Rails environment
rails tutorial
rails tutorial
rails tutorial
Where I got stuck in today's "rails tutorial" (2020/10/08)
[Rails Struggle/Rails Tutorial] What you learned in Rails Tutorial Chapter 6
Error in bundle install when running rails new
(Basic authentication) environment variables in rails and Docker
[Rails Struggle/Rails Tutorial] What you learned in Rails Tutorial Chapter 3
[Rails] Run LINEBot in local environment using ngrok
Cloud9 is out of memory: Rails tutorial memorandum
When there are environment variables in Java tests
Rails5.1 + puma SSL connection in local production environment
[Rails] Solution when migration error occurs in acts-as-taggable-on
Where I got stuck in today's "rails tutorial" (2020/10/05)
Where I got stuck in today's "rails tutorial" (2020/10/06)
500 Internal Server Error occurs in Rails production environment
Where I got stuck in today's "rails tutorial" (2020/10/04)
[Beginner] Install java development tool in cloud9 development environment.
[Rails] How to use PostgreSQL in Vagrant environment
Simple notification function in Rails (only when followed)
Where I got stuck in today's "rails tutorial" (2020/10/07)