[RAILS] Moving from AWS to PaizaCloud

at first···

I had created a development environment on AWS, but after a year, I couldn't understand the fee structure, so I moved to PaizaCloud with a flat rate. I moved to Paiza because there was an app made on AWS, The environment in WAS is Ruby 2.6.3 Ruby on Rails 5.2.4.3 Paiza's environment is Ruby 2.7.0 Ruby on Rails 6.0.3.2, 6.0.2.1, 5.0.7.2, 5.0.6 So it can't move ... As a result of trial and error, I managed to move it, so I will leave the work procedure so that even one person who has trouble with similar things will be reduced and I will not forget it myself.

Creating a server

I'm not doing anything complicated to say this. Web development is Ruby on Rails Databases are MySQL and phpMyAdmin Was selected.

Insert rbenv

Open a terminal and enter the following commands in order to enter rbenv.

$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile
$ type rbenv
rbenv is a function
rbenv ()
{
...(abridgement)...
}

$ type rbenv seems to work If you execute the command and the above rbenv is a function or later is displayed, it seems to be okay.

Install ruby-build

ruby-build seems to be a plugin of rbenv, and enter the following command to install it.

$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ rbenv install --version

With confirmation that it has been installed Do $ rbenv install --version and if the version is displayed, it is installed properly.

Check the version of Ruby that can be installed

Only the latest stable releases of each Ruby implementation are displayed
$ rbenv install --list

Show all local versions
$ rbenv install --list-all

I didn't have Ruby 2.6.3 on the stabilizer, so this time I ran $ rbenv install --list-all to make sure I had 2.6.3 and installed it!

$ rbenv install [The version you want to install]

This time I wanted to install 2.6.3, so I chose $ rbenv install 2.6.3.

Execute the following to check if it was installed, and it is OK if the installed version comes out.

$ rbenv versions
* system
  2.6.3
↑ It will be displayed like this.
*The one with it is the current version.

Version change

There seem to be the following two ways to change the version.

#System-wide version change
rbenv global [The version you want to change]
#Only partly changed version
rbenv local [The version you want to change]

This time I want to change the whole thing, so I set it to rbenv global 2.6.3. If you change it again

$ rbenv versions
  system
* 2.6.3
↑ Like this*If is moving, you can change the version.

If you can do this, close the command menu and start it up again. When I did it, if I proceeded to install rails below as it was, an error occurred and I could not proceed.

Install Ruby on Rails

Since the version of Ruby on Rails is also different, enter the version you want. Enter the following command

gem i -v [The version of Rails you want to install] rails

I want to put 5.2.4.3 this time, so gem i -v 5.2.4.3 rails And command input

After inputting, do rails -v and check that the version has changed.

With the above, I was able to change to the environment I was using before. However, there are many things I don't understand.

I just used it as a reference

https://qiita.com/toshiro3/items/6f2ee61f552fc4885317 https://qiita.com/tanakayo/items/7b85261924eca1a5a3d6

Recommended Posts

Moving from AWS to PaizaCloud
Story when moving from Spring Boot 1.5 to 2.1
Temporarily move Docker environment from Mac to AWS
Changes from Java 8 to Java 11
Sum from Java_1 to 100
Migrate from JUnit 4 to JUnit 5
From Java to Ruby !!
List how to learn from Docker to AKS on AWS
How to download images from AWS S3 (rails, carrierwave)
Moved from iBATIS to MyBatis3
Try Spring Boot from 0 to 100.
[AWS] How to check logs
Migration from Cobol to JAVA
Introducing AWS CLI to CentOS 7
Switch from slim3-gen to slim3-gen-jsr269
New features from Java7 to Java8
[IOS] How to get the table name from AWS DynamoDB
Migrating from vargrant to docker
Connect from Java to PostgreSQL
Convert from ○ months to ○ years ○ months
Rewriting from applet to application
Change from SQLite3 to PostgreSQL
From Ineffective Java to Effective Java
How to migrate from JUnit4 to JUnit5
Connect to AWS RDS from your local PC Docker environment
How to push from Tarminal to GitHub
protocol buffeer migration from 2.x to 3.x
[Note] Download from S3, upload to S3
Stop resending from client to server
Ubuntu Desktop upgrade from 18.0.4 (?) To 20.04.1 (focal)
To beginners launching Docker on AWS
Upgrade from MYSQL5.7 to 8.0 on CentOS 6.7
Migrate from on-premise Pukiwiki to esa.io \ (⁰⊖⁰) /
From introduction to use of ActiveHash
Switch from JSP + JSTL to Thymeleaf
Java to be involved from today
From Java to VB.NET-Writing Contrast Memo-
Introduction to Ruby (from other languages)
Java, interface to start from beginner
Change DB from SQLite to MySQL
Notes on migrating from CircleCI 1.0 to 2.0
Addicted to project imports from GitHub
Upgrade spring boot from 1.5 series to 2.0 series
We aim to update daily from 2021
From introduction to usage of byebug
Switch from Eclipse to VS Code
Deploy SpringBoot application to AWS EC2
The road from JavaScript to Java
Memorandum Poem (updated from time to time)
[Java] Conversion from array to List
Update MySQL from 5.7 to 8.0 with Docker
How to change from HTML to Haml