Version control of Node, Ruby and Python with anyenv

Overview

It feels like installing nodenv with anyevn and installing and managing the version of Node you want with nodenv

anyenv installation

python


$ git clone https://github.com/riywo/anyenv ~/.anyenv
$ echo 'export PATH="~/.anyenv/bin:$PATH"' >> ~/.bash_profile
$ echo 'eval "$(anyenv init -)"' >> ~/.bash_profile
$ exec $SHELL -l

#Verification
$ anyenv -v
anyenv 1.1.1

#Initialize
$ anyenv install --init

nodenv installation

python


$ anyenv install nodenv
$ echo 'export PATH="$HOME/.nodenv/bin:$PATH"' >> ~/.bash_profile
$ exec $SHELL -l

#Verification
$ nodenv -v
nodenv 1.3.1+5.dd4534e

Nodejs installation

python


$ touch $(nodenv root)/default-packages

#Installable version check
$ nodenv install --list

#Installation
$ nodenv install 14.3.0

#Verification
$ node -v
v14.3.0

#installed at the same time as npm
$ npm -v
v6.14.5

#Set to global
#If set to global, node commands will always be executed in that version
$ nodenv global 12.13.0

#Check the installed version in the list
$ nodenv versions

#When setting another version locally
#You can set the version to be set locally for each directory.
#If you set local in the directory of a specific project, it will be executed in that version
$ nodenv local 12.12.0

rbenv installation

python


$ anyenv install rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
$ exec $SHELL -l

#Verification
$ rbenv -v
rbenv 1.1.2-30-gc879cb0

Ruby installation

python


#Version check to install
$ rbenv install --list

#Install the version you want
$ rbenv install 2.7.1

#Set to global
#If set to global, node commands will always be executed in that version
$ rbenv global 2.7.1

#Verification
$ rbenv versions

#When setting another version locally
#You can set the version to be set locally for each directory.
#If you set local in the directory of a specific project, it will be executed in that version
$ rbenv local 2.6.0

BUILD FAILED error

What to do if the following error occurs

python


$ rbenv install 2.7.1

Downloading ruby-2.7.1.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.1.tar.bz2
Installing ruby-2.7.1...

BUILD FAILED (Ubuntu 20.04 using ruby-build 20200520)

Inspect or clean up the working tree at /tmp/ruby-build.20200529010032.1915.2716Kv
Results logged to /tmp/ruby-build.20200529010032.1915.log

Last 10 log lines:
checking for ruby... false
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking target system type... x86_64-pc-linux-gnu
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/tmp/ruby-build.20200529010032.1915.2716Kv/ruby-2.7.1':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

If you get an error, you may be able to solve it by running around here.

python


$ sudo apt-get update
$ sudo apt-get install -y build-essential checkinstall 
$ sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

pyenv installation

Same as above I haven't done it, but maybe I can go with the following feeling

python


$ anyenv install pyenv
$ echo 'export PATH="$HOME/.pyenv/bin:$PATH"' >> ~/.bash_profile
$ exec $SHELL -l

#Verification
$ pyenv -v

Python installation

python


#Version check to install
$ pyenv install --list

#Install the version you want
$ pyenv install [version]

#Set to global
#If set to global, node commands will always be executed in that version
$ pyenv global [version]

#Verification
$ pyenv versions

#When setting another version locally
#You can set the version to be set locally for each directory.
#If you set local in the directory of a specific project, it will be executed in that version
$ pyenv local [version]

Recommended Posts

Version control of Node, Ruby and Python with anyenv
Scraping with Node, Ruby and Python
Perform multiple version control of Go with anyenv + goenv
Comparison of CoffeeScript with JavaScript, Python and Ruby grammar
Coexistence of Python2 and 3 with CircleCI (1.0)
Encrypt with Ruby (Rails) and decrypt with Python
Easy web scraping with Python and Ruby
Correspondence summary of array operation of ruby and python
Specifying the range of ruby and python arrays
Implementation of TRIE tree with Python and LOUDS
Let's control EV3 motors and sensors with Python
About shallow and deep copies of Python / Ruby
Continuation of multi-platform development with Electron and Python
Example of reading and writing CSV with Python
Comparison of Python and Ruby (Environment / Grammar / Literal)
Ruby, Python and map
Python and Ruby split
Check version with python
I compared the speed of regular expressions in Ruby, Python, and Perl (2013 version)
Solve with Ruby and Python AtCoder ABC084 D Cumulative sum of prime numbers
I tried pipenv and asdf for Python version control
Easy partial download of mp4 with python and youtube-dl!
Difference between Ruby and Python in terms of variables
Visualize the range of interpolation and extrapolation with python
Understanding with mathematical formulas and Python LiNGAM (ICA version)
Install pyenv on Raspberry Pi and version control Python
Programming with Python and Tkinter
Encryption and decryption with Python
Python and hardware-Using RS232C with Python-
Python on Ruby and angry Ruby on Python
Python and ruby slice memo
Combination of anyenv and direnv
Zundokokiyoshi with python / ruby / Lua
Ruby and Python syntax ~ branch ~
Specify python version with virtualenv
Source installation and installation of Python
Works with Python and R
Solving with Ruby and Python AtCoder ARC 059 C Least Squares
I want to specify another version of Python with pyvenv
Solving with Ruby and Python AtCoder ABC178 D Dynamic programming
Perform isocurrent analysis of open channels with Python and matplotlib
Solving with Ruby and Python AtCoder ABC151 D Breadth-first search
Solve with Ruby and Python AtCoder ABC133 D Cumulative sum
[Python of Hikari-] Chapter 05-10 Control syntax (interruption and continuation of iteration)
Installation procedure for Python and Ansible with a specific version
Production of temperature control system with Raspberry Pi and ESP32 (1)
Solving with Ruby and Python AtCoder AISING2020 D Iterative Squares
Get rid of dirty data with Python and regular expressions
Detect objects of a specific color and size with Python
Solving with Ruby, Perl, Java and Python AtCoder ATC 002 A
Summary of Hash (Dictionary) operation support for Ruby and Python
Solving with Ruby and Python AtCoder ABC011 C Dynamic programming
Solving with Ruby and Python AtCoder ABC153 E Dynamic programming
Serial communication control with python and I2C communication (using USBGPIO8 device)
Rewrite the record addition node of SPSS Modeler with Python.
Solving with Ruby and Python AtCoder ARC067 C Prime Factorization
Solving with Ruby, Perl, Java and Python AtCoder ATC 002 B
Solving with Ruby and Python AtCoder ABC138 D Adjacency list
Sample of HTTP GET and JSON parsing with python of pepper
Serial communication control with python and SPI communication (using USBGPIO8 device)
Play with the password mechanism of GitHub Webhook and Python