asdf ã¨ãã **env
ãåå¥ã«ã¤ã³ã¹ãã¼ã«ããã¨ããä»ã¯é¸æè¢è²ã
ãããã©ã env ç³»ãæ
£ãã¦ããã®ã¨ anyenv ã 㨠**-build
ãå¥éå°å
¥ããªãã¦ãä¸ç·ã«ç¨æãã¦ããã¦æ¥½ãã¨ããåããããã®ã§ anyenv ãå°å
¥ãã¦ãã¾ãã
ãã¤ããªã¸ã®ãã¹ã¨ãã¤ã³ã¹ãã¼ã«å ã«ä¾åãã¦å¤æ´ããã¦ãã¾ãã®ã§ãéã«æ¬çªç°å¢ãªã©ã§æ¡ç¨ããã¨äºæ ã®å ãªãã§ãããããã§ã Docker æªæºã®ç°å¢ã§ã¯ãã¹ããã©ã¯ãã£ã¹ã«è¿ãåããã§ããã®ã§ãããããæãã§ããã¾ãã
äºåæºå
å¿ è¦ã«ãªãããã±ã¼ã¸ (ã©ã¤ãã©ãª) ãã¤ã³ã¹ãã¼ã«ããã
[ec2-user@localhost ~]$ sudo dnf groupinstall "Development Tools" [ec2-user@localhost ~]$ sudo dnf -y install zlib-devel bzip2 bzip2-devel readline-devel openssl-devel xz xz-devel libyaml libyaml-devel [ec2-user@localhost ~]$ sudo dnf swap libcurl-minimal libcurl-full [ec2-user@localhost ~]$ sudo dnf swap curl-minimal curl-full [ec2-user@localhost ~]$ sudo dnf install libcurl-devel.x86_64 [ec2-user@localhost ~]$ sudo dnf -y install jemalloc*
anyenv
anyenv ãã¤ã³ã¹ãã¼ã«ãã¾ãã
[ec2-user@localhost ~]$ git clone https://github.com/anyenv/anyenv ~/.anyenv [ec2-user@localhost ~]$ echo 'export PATH="$HOME/.anyenv/bin:$PATH"' >> ~/.bash_profile [ec2-user@localhost ~]$ ~/.anyenv/bin/anyenv init # Load anyenv automatically by adding # the following to ~/.bash_profile: eval "$(anyenv init -)" [ec2-user@localhost ~]$ vi ~/.bash_profile
.bash_profile
ã«ä»¥ä¸ã®å
容ã追è¨ããã
# Load anyenv automatically by adding # the following to ~/.bash_profile: eval "$(anyenv init -)"
[ec2-user@localhost ~]$ exec $SHELL -l ANYENV_DEFINITION_ROOT(/home/ec2-user/.config/anyenv/anyenv-install) doesn't exist. You can initialize it by: > anyenv install --init [ec2-user@localhost ~]$ anyenv install --init Manifest directory doesn't exist: /home/ec2-user/.config/anyenv/anyenv-install Do you want to checkout https://github.com/anyenv/anyenv-install.git? [y/N]: y Cloning https://github.com/anyenv/anyenv-install.git master to /home/ec2-user/.config/anyenv/anyenv-install... Cloning into '/home/ec2-user/.config/anyenv/anyenv-install'... remote: Enumerating objects: 71, done. remote: Counting objects: 100% (14/14), done. remote: Compressing objects: 100% (13/13), done. remote: Total 71 (delta 4), reused 4 (delta 1), pack-reused 57 (from 1) Receiving objects: 100% (71/71), 13.15 KiB | 4.38 MiB/s, done. Resolving deltas: 100% (11/11), done. Completed!
anyenv plugin ã®ã¤ã³ã¹ãã¼ã«
ããæãã« anyenv ãå©ç¨ããããã«ããã©ã°ã¤ã³ãã¤ã³ã¹ãã¼ã«ãã¦ããã¾ãã
[ec2-user@localhost ~]$ mkdir -p ~/.anyenv/plugins;cd $_ [ec2-user@localhost plugins]$ git clone https://github.com/znz/anyenv-update.git ./anyenv-update Cloning into './anyenv-update'... remote: Enumerating objects: 87, done. remote: Total 87 (delta 0), reused 0 (delta 0), pack-reused 87 (from 1) Receiving objects: 100% (87/87), 13.33 KiB | 6.67 MiB/s, done. Resolving deltas: 100% (33/33), done. [ec2-user@localhost plugins]$ git clone https://github.com/znz/anyenv-git.git ./anyenv-git Cloning into './anyenv-git'... remote: Enumerating objects: 48, done. remote: Total 48 (delta 0), reused 0 (delta 0), pack-reused 48 (from 1) Receiving objects: 100% (48/48), 7.61 KiB | 7.61 MiB/s, done. Resolving deltas: 100% (15/15), done.
ã¯ãã§ããã
ãã®å¾ã¯ã·ã§ã«åèµ·åã§ãã®ã¾ã¾ä½¿ãããã§ãããç°å¢æ§ç¯ã¨ããæå³ã§ã¯ .bash_profile
èªã¿ç´ãã§åé¡ãããªãããã¨ãããã³ã確èªããæå³ããã㦠reboot
ãã¦ã¿ãã¨ããã§ãããã
[ec2-user@localhost plugins]$ sudo reboot
**env ã®ã¤ã³ã¹ãã¼ã«
ä»åã¯ä¾ã¨ã㦠rbenv 㨠nodenv ãã¤ã³ã¹ãã¼ã«ãã¾ãã
[ec2-user@localhost ~]$ anyenv install rbenv /tmp/rbenv.20241202222214.2838 ~ Cloning https://github.com/rbenv/rbenv.git master to rbenv... Cloning into 'rbenv'... remote: Enumerating objects: 3340, done. remote: Counting objects: 100% (490/490), done. remote: Compressing objects: 100% (267/267), done. remote: Total 3340 (delta 278), reused 376 (delta 207), pack-reused 2850 (from 1) Receiving objects: 100% (3340/3340), 685.53 KiB | 10.39 MiB/s, done. Resolving deltas: 100% (2068/2068), done. ~ ~/.anyenv/envs/rbenv/plugins ~ Cloning https://github.com/rbenv/ruby-build.git master to ruby-build... Cloning into 'ruby-build'... remote: Enumerating objects: 16582, done. remote: Counting objects: 100% (4298/4298), done. remote: Compressing objects: 100% (401/401), done. remote: Total 16582 (delta 4079), reused 4023 (delta 3885), pack-reused 12284 (from 1) Receiving objects: 100% (16582/16582), 3.20 MiB | 12.12 MiB/s, done. Resolving deltas: 100% (11783/11783), done. ~ Install rbenv succeeded! Please reload your profile (exec $SHELL -l) or open a new session. [ec2-user@localhost ~]$ exec $SHELL -l [ec2-user@localhost ~]$ anyenv install nodenv /tmp/nodenv.20241202222229.2993 ~ Cloning https://github.com/nodenv/nodenv.git master to nodenv... Cloning into 'nodenv'... remote: Enumerating objects: 4519, done. remote: Counting objects: 100% (516/516), done. remote: Compressing objects: 100% (268/268), done. remote: Total 4519 (delta 264), reused 473 (delta 237), pack-reused 4003 (from 1) Receiving objects: 100% (4519/4519), 885.40 KiB | 11.96 MiB/s, done. Resolving deltas: 100% (2895/2895), done. ~ ~/.anyenv/envs/nodenv/plugins ~ Cloning https://github.com/nodenv/node-build.git master to node-build... Cloning into 'node-build'... remote: Enumerating objects: 28219, done. remote: Counting objects: 100% (3685/3685), done. remote: Compressing objects: 100% (1374/1374), done. remote: Total 28219 (delta 2313), reused 2793 (delta 2233), pack-reused 24534 (from 1) Receiving objects: 100% (28219/28219), 5.23 MiB | 16.88 MiB/s, done. Resolving deltas: 100% (18053/18053), done. ~ ~/.anyenv/envs/nodenv/plugins ~ Cloning https://github.com/nodenv/nodenv-vars.git master to nodenv-vars... Cloning into 'nodenv-vars'... remote: Enumerating objects: 211, done. remote: Total 211 (delta 0), reused 0 (delta 0), pack-reused 211 (from 1) Receiving objects: 100% (211/211), 31.82 KiB | 7.96 MiB/s, done. Resolving deltas: 100% (76/76), done. ~ Install nodenv succeeded! Please reload your profile (exec $SHELL -l) or open a new session. [ec2-user@localhost ~]$ exec $SHELL -l
ã§ããã **-build
ãªã©ã®ãã©ã°ã¤ã³ãä¸ç·ã«ã¤ã³ã¹ãã¼ã«ããã¦ããã®ã§å¤§ä¸å¤«ããã§ããã
rbenv 㧠ruby ãã¤ã³ã¹ãã¼ã« (jemalloc æå¹åãã¦)
ãã£ãããªã®ã§ jemalloc æå¹åãã ruby ç°å¢ãç¨æãã¦ã¿ã¾ãããã env 系使ããã㦠Docker 移è¡ãã¦ããªããã¨ããæ³å®ã 㨠Ruby 2.x ç³»ãã¢ããã¼ã·ã§ã³ã¨ãã¦ä¸çªå¤ããã®ã§ããã®ãããã§é©å½ã«ã
[ec2-user@localhost ~]$ RUBY_CONFIGURE_OPTS=--with-jemalloc rbenv install 2.7.5 ==> Downloading openssl-1.1.1w.tar.gz... -> curl -q -fL -o openssl-1.1.1w.tar.gz https://dqw8nmjcqpjn7.cloudfront.net/cf3098950cb4d853ad95c0841f1f9c6d3dc102dccfcacd521d93925208b76ac8 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 9661k 100 9661k 0 0 34.0M 0 --:--:-- --:--:-- --:--:-- 34.0M ==> Installing openssl-1.1.1w... -> ./config "--prefix=$HOME/.anyenv/envs/rbenv/versions/2.7.5/openssl" "--openssldir=$HOME/.anyenv/envs/rbenv/versions/2.7.5/openssl/ssl" --libdir=lib zlib-dynamic no-ssl3 shared -> make -j 2 -> make install_sw install_ssldirs ==> Installed openssl-1.1.1w to /home/ec2-user/.anyenv/envs/rbenv/versions/2.7.5 ==> Downloading ruby-2.7.5.tar.bz2... -> curl -q -fL -o ruby-2.7.5.tar.bz2 https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.5.tar.bz2 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 14.1M 100 14.1M 0 0 15.8M 0 --:--:-- --:--:-- --:--:-- 15.8M ==> Installing ruby-2.7.5... WARNING: ruby-2.7.5 is past its end of life and is now unsupported. It no longer receives bug fixes or critical security updates. -> ./configure "--prefix=$HOME/.anyenv/envs/rbenv/versions/2.7.5" "--with-openssl-dir=$HOME/.anyenv/envs/rbenv/versions/2.7.5/openssl" --enable-shared --with-ext=openssl,psych,+ --with-jemalloc -> make -j 2 -> make install ==> Installed ruby-2.7.5 to /home/ec2-user/.anyenv/envs/rbenv/versions/2.7.5 NOTE: to activate this Ruby version as the new default, run: rbenv global 2.7.5 [ec2-user@localhost ~]$ rbenv global 2.7.5 [ec2-user@localhost ~]$ ruby -v ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
ç¡äºã«ã¤ã³ã¹ãã¼ã«ã§ãã¾ãããã ãªãã¹ãã¯ããã« Docker ã«å¼ã£è¶ããããã«ãã¾ãããã
åè
é常 /usr/local/bin
以ä¸ãªã©ã«é
ç½®ããã gem ã¯ãæ¦ã以ä¸ã«é
ç½®ãããã®ã§ã capistrano-**
ãªã©ä½¿ã£ã¦ãããªãããã®ã³ãã³ãããã«ãã¹ã§æ¸ãã¦ããããªã©ã®å ´åã¯ãã©ãã¼ãå¿
è¦ãªã®ã§æ³¨æãã¾ããã (ä¸æ) ã
[ec2-user@localhost ~]$ ls -lha ~/.anyenv/envs/rbenv/shims/ total 68K drwxr-xr-x. 2 ec2-user ec2-user 168 Dec 5 21:05 . drwxr-xr-x. 14 ec2-user ec2-user 16K Dec 2 23:05 .. -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 bundle -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 bundler -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 erb -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 gem -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 irb -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 racc -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 racc2y -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 23:17 rackup -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 rake -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 rdoc -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 ri -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 ruby -rwxr-xr-x. 1 ec2-user ec2-user 423 Dec 2 22:43 y2racc
ï¼åè