macOS 10.15.5 Rails 5.2.4.2 Docker 19.03.12
After building the Rails development environment with Docker, I try to use Console. The IRB is displayed as shown below.
irb(main):001:0>
However, I will show you how to install ** Pry **, which is useful for Rails development, after building a Rails development environment with Docker.
Gemfile
gem "pry-rails"
gem "pry-byebug"
terminal
$ bundle install
Then try running the Console.
terminal
$ rails console
However, an error occurred and the following message was displayed at the end of the error statement.
terminal
`autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
It looks like a "JavaScript runtime not found" error. So I tried to install node.js. Install node.js using homebrew.
terminal
$ brew install nodejs
Then run the console.
$ rails console
[1] pry(main)>
We have successfully installed and implemented Pry!
Recommended Posts