Until ruby can be used on windows ...

It's been a long time before I could do rbenv install 2.7.1 to use Ruby on Windows 10, so I summarized it.



The things to do are as follows.

  1. Initialization settings: ʻecho'eval" $ (rbenv init-) "'>> ~ / .bash_profile`
  2. Save settings: source ~ / .bash_profile
  3. Install rbenv: brew install rbenv ruby-build
  4. Install by version: rbenv install 2.7.1
  5. Set the version of rbenv to use: rbenv global 2.7.1
  6. Install ruby: sudo apt install ruby

If all of these commands pass without error, the rest of the story is irrelevant. Since this is the first setting, the environment is not ready, and I will describe the error that occurred and how to deal with it. If you have the same error, please refer to it. I'm entering commands in order from the top.

table of contents

  1. Setting .bash_profile
  2. Install Homebrew
  3. Install rbenv

.bash_profile settings

Error: No such file or directory
Cause:.bash_I tried to add it where the profile file doesn't exist
Correspondence:.bash_Create profile file

Corrective action: touch ~ / .bash_profile

Error: Command'rbenv' not found, but can be installed with: sudo apt install rbenv
Cause:$(rbenv init -)I'm trying to use the rbenv command, but I don't understand rbenv
Action: Install rbenv

Corrective action: brew install rbenv ruby-build

Error: Command'brew' not found 
Cause: I don't know brew
Action: Install Homebrew

Install Homebrew

Error: Command'brew' not found
Cause: I don't know where the installed Homebrew is.
Action: Give it through the path to Homebrew

Corrective action: ʻecho'export PATH = "/ home / linuxbrew / .linuxbrew / bin: $ PATH"' >> ~ / .bashrc Corrective action:source ~ / .bashrc`

Error: Command'brew' not found
Cause:.bash_You also need to pass the path to the profile file
Correspondence:.bash_Add settings to profile file

Corrective action: ʻecho export PATH ='/ usr / local / bin: $ PATH' >> ~ / .bash_profile Corrective action:source ~ / .bash_profile`

Install rbenv

Error: configure: error: C compiler cannot create executables
Cause: Homebrew didn't have what it needed
Action: Install what is missing

Workaround: sudo apt install build-essential curl file git

Error: E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
Cause: apt-get is not up to date
Correspondence: apt-update get

Corrective action: sudo apt-get update

Error: ERROR: Ruby install aborted due to missing extensions. Try running apt-get install -y zlib1g-dev to fetch missing dependencies.
Cause: zlib1g-There seems to be no dev
Correspondence: zlib1g-install dev

Workaround: sudo apt-get install -y zlib1g-dev

Error: Command'ruby' not found, but can be installed with: sudo apt install ruby
Cause: ruby itself is not yet
Action: Install ruby

Corrective action: sudo apt install ruby


I would be very grateful if you could let me know if there is something wrong with the cause or response. I hope it will be helpful for you!

What I used as a reference

Thank you very much for your help.

This question

Notes for researching and summarizing

Recommended Posts

Until ruby can be used on windows ...
Initial settings until S2Dao can be used
[Ruby] Methods that can be used with strings
Range where variables can be used with ruby [Scope]
Firebase-Realtime Database on Android that can be used with copy
[Ruby on Rails] Stop "looping until ..."
Ruby on Rails 5 quick learning practice guide that can be used in the field Summary
Static analysis tool that can be used on GitHub [Java version]
Upgrade and switch Ruby versions on Windows 10
A memo that enabled VS Code + JUnit 5 to be used on Windows 10
Ruby array methods that can be used with Rails (other than each)
[Ruby on Rails] Until the introduction of RSpec
How to configure ubuntu to be used on GCP
Rails new in Ruby on Rails ~ Memorandum until deployment 2
[Personal memo] Ruby on Rails environment construction (Windows)
Organize methods that can be used with StringUtils
Rails new in Ruby on Rails ~ Memorandum until deployment 1
[Solution] Java cannot be installed on Windows 10 + ATOK 2017
Systemctl cannot be used on Ubuntu inside Docker container
Logitech trackball mouse TM-150r can be wheeled on Ubuntu 20.04
Scala String can be used other than java.lang.String method
About the matter that hidden_field can be used insanely
Ruby on Rails Tutorial Troublesome notes when running on Windows
Convenient shortcut keys that can be used in Eclipse
Install Corretto 8 on Windows
Install Ruby on Ubuntu 20.04
Ruby on Rails Elementary
Ruby on Rails basics
Ruby On Rails Association
Learning Ruby with AtCoder Beginners Selection [Some Sums] Increase the methods that can be used
M.S. docker on Windows
[Ruby on Rails] Only the user who posted can edit
Summary of css selectors that can be used with Nookogiri
Difficulties in building a Ruby on Rails environment (Windows 10) (SQLite3)
Create a page control that can be used with RecyclerView
Four-in-a-row with gravity that can be played on the console
iOS apps can no longer be uploaded on fastlane (2020/10, version 2.150.0)
[Question] Can nullif be used in the count function in JPQL?
Whether options can be used due to different Java versions