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.
I'm not doing anything complicated to say this. Web development is Ruby on Rails Databases are MySQL and phpMyAdmin Was selected.
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.
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.
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.
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.
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.
https://qiita.com/toshiro3/items/6f2ee61f552fc4885317 https://qiita.com/tanakayo/items/7b85261924eca1a5a3d6
Recommended Posts