mac rails 新規プロジェクト立ち上げた際のエラーとそのデバッグ
$ cat << EOS > Gemfile
> source "http://rubygems.org"
> gem "rails"
> EOS
$ bundle install --path vendor/bundle
Fetching gem metadata from http://rubygems.org/...................
Using rake 12.3.3
Using concurrent-ruby 1.1.5
Using i18n 1.6.0
Using minitest 5.11.3
Using thread_safe 0.3.6
Using tzinfo 1.2.5
Fetching zeitwerk 2.1.10
Installing zeitwerk 2.1.10
Gem::InstallError: zeitwerk requires Ruby version >= 2.4.4.
An error occurred while installing zeitwerk (2.1.10), and Bundler cannot continue.
Make sure that `gem install zeitwerk -v '2.1.10' --source 'http://rubygems.org/'` succeeds before bundling.
In Gemfile:
rails was resolved to 6.0.0, which depends on
actioncable was resolved to 6.0.0, which depends on
actionpack was resolved to 6.0.0, which depends on
actionview was resolved to 6.0.0, which depends on
rails-dom-testing was resolved to 2.0.3, which depends on
activesupport was resolved to 6.0.0, which depends on
zeitwerk
rbenvとrubyのバージョンが異なる理由
which ruby
/usr/bin/ruby
rbenvで設定したファイルよりも先にきているので古いversionが
インストールされている。
解決策
.bash_profileを開いてパスを設定
$ vim ~/.bash_profile
以下の二行を貼り付けて保存
export PATH="$HOME/.rbenv/bin:$PATH" eval "$(rbenv init -)”
.bash_profileの変更を反映させる
$ source ~/.bash_profile
Ruby2.6.4 bundle install 時のエラー
An error occurred while installing mysql2 (0.5.2), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/'` succeeds before bundling. In Gemfile: mysql2 $ gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/' Building native extensions. This could take a while... ERROR: Error installing mysql2: ERROR: Failed to build gem native extension.
Mojave用macOS SDK header追加
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
エラーログのコマンドを実行
gem install mysql2 -v '0.5.2' --source 'https://rubygems.org/‘
migrateしようとしたところ、下記のようなエラーが出た。
$ rails g model User name:string email:string password_digest:string
Rails is not currently installed on this system. To get the latest version, simply type: $ sudo gem install rails You can then rerun your "rails" command. $ sudo gem install rails Password: Fetching activesupport-6.0.0.gem Fetching i18n-1.6.0.gem Fetching tzinfo-1.2.5.gem Fetching concurrent-ruby-1.1.5.gem Fetching thread_safe-0.3.6.gem Fetching rack-2.0.7.gem Fetching rack-test-1.1.0.gem Fetching crass-1.0.4.gem Fetching loofah-2.2.3.gem Fetching rails-html-sanitizer-1.2.0.gem Fetching rails-dom-testing-2.0.3.gem Fetching builder-3.2.3.gem Fetching erubi-1.8.0.gem Fetching actionview-6.0.0.gem Fetching actionpack-6.0.0.gem Fetching activemodel-6.0.0.gem Fetching activerecord-6.0.0.gem Fetching globalid-0.4.2.gem Fetching activejob-6.0.0.gem Fetching mini_mime-1.0.2.gem Fetching mail-2.7.1.gem Fetching actionmailer-6.0.0.gem Fetching nio4r-2.5.1.gem Fetching websocket-extensions-0.1.4.gem Fetching websocket-driver-0.7.1.gem Fetching actioncable-6.0.0.gem Fetching mimemagic-0.3.3.gem Fetching marcel-0.3.3.gem Fetching activestorage-6.0.0.gem Fetching actionmailbox-6.0.0.gem Fetching actiontext-6.0.0.gem Fetching thor-0.20.3.gem Fetching method_source-0.9.2.gem Fetching railties-6.0.0.gem Fetching sprockets-3.7.2.gem Fetching sprockets-rails-3.2.1.gem Fetching rails-6.0.0.gem Successfully installed concurrent-ruby-1.1.5 HEADS UP! i18n 1.1 changed fallbacks to exclude default locale. But that may break your application. Please check your Rails app for 'config.i18n.fallbacks = true'. If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be 'config.i18n.fallbacks = [I18n.default_locale]'. If not, fallbacks will be broken in your app by I18n 1.1.x. For more info see: https://github.com/svenfuchs/i18n/releases/tag/v1.1.0 Successfully installed i18n-1.6.0 Successfully installed thread_safe-0.3.6 Successfully installed tzinfo-1.2.5 Successfully installed activesupport-6.0.0 Successfully installed rack-2.0.7 Successfully installed rack-test-1.1.0 Successfully installed crass-1.0.4 Successfully installed loofah-2.2.3 Successfully installed rails-html-sanitizer-1.2.0 Successfully installed rails-dom-testing-2.0.3 Successfully installed builder-3.2.3 Successfully installed erubi-1.8.0 Successfully installed actionview-6.0.0 Successfully installed actionpack-6.0.0 Successfully installed activemodel-6.0.0 Successfully installed activerecord-6.0.0 Successfully installed globalid-0.4.2 Successfully installed activejob-6.0.0 Successfully installed mini_mime-1.0.2 Successfully installed mail-2.7.1 Successfully installed actionmailer-6.0.0 Building native extensions. This could take a while... Successfully installed nio4r-2.5.1 Successfully installed websocket-extensions-0.1.4 Building native extensions. This could take a while... Successfully installed websocket-driver-0.7.1 Successfully installed actioncable-6.0.0 Successfully installed mimemagic-0.3.3 Successfully installed marcel-0.3.3 Successfully installed activestorage-6.0.0 Successfully installed actionmailbox-6.0.0 Successfully installed actiontext-6.0.0 Successfully installed thor-0.20.3 Successfully installed method_source-0.9.2 Successfully installed railties-6.0.0 Successfully installed sprockets-3.7.2 Successfully installed sprockets-rails-3.2.1 Successfully installed rails-6.0.0 Parsing documentation for concurrent-ruby-1.1.5 Installing ri documentation for concurrent-ruby-1.1.5 Parsing documentation for i18n-1.6.0 Installing ri documentation for i18n-1.6.0 Parsing documentation for thread_safe-0.3.6 Installing ri documentation for thread_safe-0.3.6 Parsing documentation for tzinfo-1.2.5 Installing ri documentation for tzinfo-1.2.5 Parsing documentation for activesupport-6.0.0 Installing ri documentation for activesupport-6.0.0 Parsing documentation for rack-2.0.7 Installing ri documentation for rack-2.0.7 Parsing documentation for rack-test-1.1.0 Installing ri documentation for rack-test-1.1.0 Parsing documentation for crass-1.0.4 Installing ri documentation for crass-1.0.4 Parsing documentation for loofah-2.2.3 Installing ri documentation for loofah-2.2.3 Parsing documentation for rails-html-sanitizer-1.2.0 Installing ri documentation for rails-html-sanitizer-1.2.0 Parsing documentation for rails-dom-testing-2.0.3 Installing ri documentation for rails-dom-testing-2.0.3 Parsing documentation for builder-3.2.3 Installing ri documentation for builder-3.2.3 Parsing documentation for erubi-1.8.0 Installing ri documentation for erubi-1.8.0 Parsing documentation for actionview-6.0.0 Installing ri documentation for actionview-6.0.0 Parsing documentation for actionpack-6.0.0 Installing ri documentation for actionpack-6.0.0 Parsing documentation for activemodel-6.0.0 Installing ri documentation for activemodel-6.0.0 Parsing documentation for activerecord-6.0.0 Installing ri documentation for activerecord-6.0.0 Parsing documentation for globalid-0.4.2 Installing ri documentation for globalid-0.4.2 Parsing documentation for activejob-6.0.0 Installing ri documentation for activejob-6.0.0 Parsing documentation for mini_mime-1.0.2 Installing ri documentation for mini_mime-1.0.2 Parsing documentation for mail-2.7.1 Installing ri documentation for mail-2.7.1 Parsing documentation for actionmailer-6.0.0 Installing ri documentation for actionmailer-6.0.0 Parsing documentation for nio4r-2.5.1 Installing ri documentation for nio4r-2.5.1 Parsing documentation for websocket-extensions-0.1.4 Installing ri documentation for websocket-extensions-0.1.4 Parsing documentation for websocket-driver-0.7.1 Installing ri documentation for websocket-driver-0.7.1 Parsing documentation for actioncable-6.0.0 Installing ri documentation for actioncable-6.0.0 Parsing documentation for mimemagic-0.3.3 Installing ri documentation for mimemagic-0.3.3 Parsing documentation for marcel-0.3.3 Installing ri documentation for marcel-0.3.3 Parsing documentation for activestorage-6.0.0 Installing ri documentation for activestorage-6.0.0 Parsing documentation for actionmailbox-6.0.0 Installing ri documentation for actionmailbox-6.0.0 Parsing documentation for actiontext-6.0.0 Installing ri documentation for actiontext-6.0.0 Parsing documentation for thor-0.20.3 Installing ri documentation for thor-0.20.3 Parsing documentation for method_source-0.9.2 Installing ri documentation for method_source-0.9.2 Parsing documentation for railties-6.0.0 Installing ri documentation for railties-6.0.0 Parsing documentation for sprockets-3.7.2 Installing ri documentation for sprockets-3.7.2 Parsing documentation for sprockets-rails-3.2.1 Installing ri documentation for sprockets-rails-3.2.1 Parsing documentation for rails-6.0.0 Installing ri documentation for rails-6.0.0 Done installing documentation for concurrent-ruby, i18n, thread_safe, tzinfo, activesupport, rack, rack-test, crass, loofah, rails-html-sanitizer, rails-dom-testing, builder, erubi, actionview, actionpack, activemodel, activerecord, globalid, activejob, mini_mime, mail, actionmailer, nio4r, websocket-extensions, websocket-driver, actioncable, mimemagic, marcel, activestorage, actionmailbox, actiontext, thor, method_source, railties, sprockets, sprockets-rails, rails after 27 seconds 37 gems installed $ rails g model User name:string email:string password_digest:string Rails is not currently installed on this system. To get the latest version, simply type: $ sudo gem install rails You can then rerun your "rails" command. $
以下、無限に続きそうなので、ぐぐったところ下記のような記事あり。
http://tomoprog.hatenablog.com/entry/2017/02/03/015936
$ export PATH="$HOME/.rbenv/shims:$PATH"
$ sudo gem install rails Password: Sorry, try again. Password: Successfully installed rails-6.0.0 Parsing documentation for rails-6.0.0 Done installing documentation for rails after 0 seconds 1 gem installed
$ rails g model User name:string email:string password_digest:string Traceback (most recent call last): 25: from bin/rails:4:in `<main>' model User name:string email:string password_digest:string Traceback (most recent call last):
〜省略〜 RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production environment invoke active_record The name 'User' is either already used in your application or reserved by Ruby on Rails. Please choose an alternative and run this generator again. $ bundle exec rails webpacker:install sh: node: command not found sh: nodejs: command not found Node.js not installed. Please download and install Node.js https://nodejs.org/en/download/ $ bundle exec rails webpacker:install sh: node: command not found sh: nodejs: command not found Node.js not installed. Please download and install Node.js https://nodejs.org/en/download/ $ nodejs -v bash: nodejs: command not found $ nodebrew ls-remote bash: nodebrew: command not found $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ==> This script will install: /usr/local/bin/brew /usr/local/share/doc/homebrew /usr/local/share/man/man1/brew.1 /usr/local/share/zsh/site-functions/_brew /usr/local/etc/bash_completion.d/brew /usr/local/Homebrew Press RETURN to continue or any other key to abort $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ==> This script will install: /usr/local/bin/brew /usr/local/share/doc/homebrew /usr/local/share/man/man1/brew.1 /usr/local/share/zsh/site-functions/_brew /usr/local/etc/bash_completion.d/brew /usr/local/Homebrew Press RETURN to continue or any other key to abort ==> Downloading and installing Homebrew... remote: Enumerating objects: 14, done. remote: Counting objects: 100% (14/14), done. remote: Compressing objects: 100% (8/8), done. remote: Total 14 (delta 6), reused 10 (delta 6), pack-reused 0 Unpacking objects: 100% (14/14), done. From https://github.com/Homebrew/brew 4a3442d1a..373a454ac master -> origin/master HEAD is now at 373a454ac Merge pull request #6444 from Homebrew/dependabot/bundler/Library/Homebrew/parser-2.6.4.1 Updated 1 tap (homebrew/core). ==> Updated Formulae auditbeat kibana metricbeat snakemake starship elasticsearch logstash nats-streaming-server snownews traefik ==> Installation successful! ==> Homebrew has enabled anonymous aggregate formulae and cask analytics. Read the analytics documentation (and how to opt-out) here: https://docs.brew.sh/Analytics ==> Homebrew is run entirely by unpaid volunteers. Please consider donating: https://github.com/Homebrew/brew#donations ==> Next steps: - Run `brew help` to get started - Further documentation: https://docs.brew.sh $ brew install nodebrew ==> Downloading https://github.com/hokaccha/nodebrew/archive/v1.0.1.tar.gz ==> Downloading from https://codeload.github.com/hokaccha/nodebrew/tar.gz/v1.0.1 ######################################################################## 100.0% ==> Caveats You need to manually run setup_dirs to create directories required by nodebrew: /usr/local/opt/nodebrew/bin/nodebrew setup_dirs Add path: export PATH=$HOME/.nodebrew/current/bin:$PATH To use Homebrew's directories rather than ~/.nodebrew add to your profile: export NODEBREW_ROOT=/usr/local/var/nodebrew Bash completion has been installed to: /usr/local/etc/bash_completion.d zsh completions have been installed to: /usr/local/share/zsh/site-functions ==> Summary 🍺 /usr/local/Cellar/nodebrew/1.0.1: 8 files, 38.6KB, built in 3 seconds $ nodebrew -v nodebrew 1.0.1 Usage: nodebrew help Show this message nodebrew install <version> Download and install <version> (from binary) nodebrew compile <version> Download and install <version> (from source) nodebrew install-binary <version> Alias of `install` (For backword compatibility) nodebrew uninstall <version> Uninstall <version> nodebrew use <version> Use <version> nodebrew list List installed versions nodebrew ls Alias for `list` nodebrew ls-remote List remote versions nodebrew ls-all List remote and installed versions nodebrew alias <key> <value> Set alias nodebrew unalias <key> Remove alias nodebrew clean <version> | all Remove source file nodebrew selfupdate Update nodebrew nodebrew migrate-package <version> Install global NPM packages contained in <version> to current version nodebrew exec <version> -- <command> Execute <command> using specified <version> Example: # install nodebrew install v8.9.4 # use a specific version number nodebrew use v8.9.4 $ nodebrew install-binary latest Fetching: https://nodejs.org/dist/v12.10.0/node-v12.10.0-darwin-x64.tar.gz Warning: Failed to create the file Warning: /Users/x/.nodebrew/src/v12.10.0/node-v12.10.0-darwin-x64.tar.gz: Warning: No such file or directory curl: (23) Failed writing body (0 != 1058) download failed: https://nodejs.org/dist/v12.10.0/node-v12.10.0-darwin-x64.tar.gz $ nodebrew list No such file or directory at /usr/local/bin/nodebrew line 575. $ nodebrew ls-remote v0.0.1 v0.0.2 v0.0.3 v0.0.4 v0.0.5 v0.0.6 v0.1.0 v0.1.1 v0.1.2 v0.1.3 v0.1.4 v0.1.5 v0.1.6 v0.1.7 v0.1.8 v0.1.9 v0.1.10 v0.1.11 v0.1.12 v0.1.13 v0.1.14 v0.1.15 v0.1.16 v0.1.17 v0.1.18 v0.1.19 v0.1.20 v0.1.21 v0.1.22 v0.1.23 v0.1.24 v0.1.25 v0.1.26 v0.1.27 v0.1.28 v0.1.29 v0.1.30 v0.1.31 v0.1.32 v0.1.33 v0.1.90 v0.1.91 v0.1.92 v0.1.93 v0.1.94 v0.1.95 v0.1.96 v0.1.97 v0.1.98 v0.1.99 v0.1.100 v0.1.101 v0.1.102 v0.1.103 v0.1.104 v0.2.0 v0.2.1 v0.2.2 v0.2.3 v0.2.4 v0.2.5 v0.2.6 v0.3.0 v0.3.1 v0.3.2 v0.3.3 v0.3.4 v0.3.5 v0.3.6 v0.3.7 v0.3.8 v0.4.0 v0.4.1 v0.4.2 v0.4.3 v0.4.4 v0.4.5 v0.4.6 v0.4.7 v0.4.8 v0.4.9 v0.4.10 v0.4.11 v0.4.12 v0.5.0 v0.5.1 v0.5.2 v0.5.3 v0.5.4 v0.5.5 v0.5.6 v0.5.7 v0.5.8 v0.5.9 v0.5.10 v0.6.0 v0.6.1 v0.6.2 v0.6.3 v0.6.4 v0.6.5 v0.6.6 v0.6.7 v0.6.8 v0.6.9 v0.6.10 v0.6.11 v0.6.12 v0.6.13 v0.6.14 v0.6.15 v0.6.16 v0.6.17 v0.6.18 v0.6.19 v0.6.20 v0.6.21 v0.7.0 v0.7.1 v0.7.2 v0.7.3 v0.7.4 v0.7.5 v0.7.6 v0.7.7 v0.7.8 v0.7.9 v0.7.10 v0.7.11 v0.7.12 v0.8.0 v0.8.1 v0.8.2 v0.8.3 v0.8.4 v0.8.5 v0.8.6 v0.8.7 v0.8.8 v0.8.9 v0.8.10 v0.8.11 v0.8.12 v0.8.13 v0.8.14 v0.8.15 v0.8.16 v0.8.17 v0.8.18 v0.8.19 v0.8.20 v0.8.21 v0.8.22 v0.8.23 v0.8.24 v0.8.25 v0.8.26 v0.8.27 v0.8.28 v0.9.0 v0.9.1 v0.9.2 v0.9.3 v0.9.4 v0.9.5 v0.9.6 v0.9.7 v0.9.8 v0.9.9 v0.9.10 v0.9.11 v0.9.12 v0.10.0 v0.10.1 v0.10.2 v0.10.3 v0.10.4 v0.10.5 v0.10.6 v0.10.7 v0.10.8 v0.10.9 v0.10.10 v0.10.11 v0.10.12 v0.10.13 v0.10.14 v0.10.15 v0.10.16 v0.10.17 v0.10.18 v0.10.19 v0.10.20 v0.10.21 v0.10.22 v0.10.23 v0.10.24 v0.10.25 v0.10.26 v0.10.27 v0.10.28 v0.10.29 v0.10.30 v0.10.31 v0.10.32 v0.10.33 v0.10.34 v0.10.35 v0.10.36 v0.10.37 v0.10.38 v0.10.39 v0.10.40 v0.10.41 v0.10.42 v0.10.43 v0.10.44 v0.10.45 v0.10.46 v0.10.47 v0.10.48 v0.11.0 v0.11.1 v0.11.2 v0.11.3 v0.11.4 v0.11.5 v0.11.6 v0.11.7 v0.11.8 v0.11.9 v0.11.10 v0.11.11 v0.11.12 v0.11.13 v0.11.14 v0.11.15 v0.11.16 v0.12.0 v0.12.1 v0.12.2 v0.12.3 v0.12.4 v0.12.5 v0.12.6 v0.12.7 v0.12.8 v0.12.9 v0.12.10 v0.12.11 v0.12.12 v0.12.13 v0.12.14 v0.12.15 v0.12.16 v0.12.17 v0.12.18 v4.0.0 v4.1.0 v4.1.1 v4.1.2 v4.2.0 v4.2.1 v4.2.2 v4.2.3 v4.2.4 v4.2.5 v4.2.6 v4.3.0 v4.3.1 v4.3.2 v4.4.0 v4.4.1 v4.4.2 v4.4.3 v4.4.4 v4.4.5 v4.4.6 v4.4.7 v4.5.0 v4.6.0 v4.6.1 v4.6.2 v4.7.0 v4.7.1 v4.7.2 v4.7.3 v4.8.0 v4.8.1 v4.8.2 v4.8.3 v4.8.4 v4.8.5 v4.8.6 v4.8.7 v4.9.0 v4.9.1 v5.0.0 v5.1.0 v5.1.1 v5.2.0 v5.3.0 v5.4.0 v5.4.1 v5.5.0 v5.6.0 v5.7.0 v5.7.1 v5.8.0 v5.9.0 v5.9.1 v5.10.0 v5.10.1 v5.11.0 v5.11.1 v5.12.0 v6.0.0 v6.1.0 v6.2.0 v6.2.1 v6.2.2 v6.3.0 v6.3.1 v6.4.0 v6.5.0 v6.6.0 v6.7.0 v6.8.0 v6.8.1 v6.9.0 v6.9.1 v6.9.2 v6.9.3 v6.9.4 v6.9.5 v6.10.0 v6.10.1 v6.10.2 v6.10.3 v6.11.0 v6.11.1 v6.11.2 v6.11.3 v6.11.4 v6.11.5 v6.12.0 v6.12.1 v6.12.2 v6.12.3 v6.13.0 v6.13.1 v6.14.0 v6.14.1 v6.14.2 v6.14.3 v6.14.4 v6.15.0 v6.15.1 v6.16.0 v6.17.0 v6.17.1 v7.0.0 v7.1.0 v7.2.0 v7.2.1 v7.3.0 v7.4.0 v7.5.0 v7.6.0 v7.7.0 v7.7.1 v7.7.2 v7.7.3 v7.7.4 v7.8.0 v7.9.0 v7.10.0 v7.10.1 v8.0.0 v8.1.0 v8.1.1 v8.1.2 v8.1.3 v8.1.4 v8.2.0 v8.2.1 v8.3.0 v8.4.0 v8.5.0 v8.6.0 v8.7.0 v8.8.0 v8.8.1 v8.9.0 v8.9.1 v8.9.2 v8.9.3 v8.9.4 v8.10.0 v8.11.0 v8.11.1 v8.11.2 v8.11.3 v8.11.4 v8.12.0 v8.13.0 v8.14.0 v8.14.1 v8.15.0 v8.15.1 v8.16.0 v8.16.1 v9.0.0 v9.1.0 v9.2.0 v9.2.1 v9.3.0 v9.4.0 v9.5.0 v9.6.0 v9.6.1 v9.7.0 v9.7.1 v9.8.0 v9.9.0 v9.10.0 v9.10.1 v9.11.0 v9.11.1 v9.11.2 v10.0.0 v10.1.0 v10.2.0 v10.2.1 v10.3.0 v10.4.0 v10.4.1 v10.5.0 v10.6.0 v10.7.0 v10.8.0 v10.9.0 v10.10.0 v10.11.0 v10.12.0 v10.13.0 v10.14.0 v10.14.1 v10.14.2 v10.15.0 v10.15.1 v10.15.2 v10.15.3 v10.16.0 v10.16.1 v10.16.2 v10.16.3 v11.0.0 v11.1.0 v11.2.0 v11.3.0 v11.4.0 v11.5.0 v11.6.0 v11.7.0 v11.8.0 v11.9.0 v11.10.0 v11.10.1 v11.11.0 v11.12.0 v11.13.0 v11.14.0 v11.15.0 v12.0.0 v12.1.0 v12.2.0 v12.3.0 v12.3.1 v12.4.0 v12.5.0 v12.6.0 v12.7.0 v12.8.0 v12.8.1 v12.9.0 v12.9.1 v12.10.0 io@v1.0.0 io@v1.0.1 io@v1.0.2 io@v1.0.3 io@v1.0.4 io@v1.1.0 io@v1.2.0 io@v1.3.0 io@v1.4.1 io@v1.4.2 io@v1.4.3 io@v1.5.0 io@v1.5.1 io@v1.6.0 io@v1.6.1 io@v1.6.2 io@v1.6.3 io@v1.6.4 io@v1.7.1 io@v1.8.1 io@v1.8.2 io@v1.8.3 io@v1.8.4 io@v2.0.0 io@v2.0.1 io@v2.0.2 io@v2.1.0 io@v2.2.0 io@v2.2.1 io@v2.3.0 io@v2.3.1 io@v2.3.2 io@v2.3.3 io@v2.3.4 io@v2.4.0 io@v2.5.0 io@v3.0.0 io@v3.1.0 io@v3.2.0 io@v3.3.0 io@v3.3.1 $ nodebrew install-binary latest Fetching: https://nodejs.org/dist/v12.10.0/node-v12.10.0-darwin-x64.tar.gz Warning: Failed to create the file Warning: /Users/x/.nodebrew/src/v12.10.0/node-v12.10.0-darwin-x64.tar.gz: Warning: No such file or directory curl: (23) Failed writing body (0 != 1058) download failed: https://nodejs.org/dist/v12.10.0/node-v12.10.0-darwin-x64.tar.gz $ mkdir -p ~/.nodebrew/src $ nodebrew install-binary latest Fetching: https://nodejs.org/dist/v12.10.0/node-v12.10.0-darwin-x64.tar.gz ######################################################################## 100.0% Installed successfully
## viコマンドでhomeディレクトリ配下の.bash_profileを開きます。 ## .bash_profileが存在しない場合は新規作成されます。 $ vi ~/.bash_profile ## 「i」を入力し、インサートモードにし、以下の内容をコピー&ペーストしてください。 # for nodebrew export PATH=$HOME/.nodebrew/current/bin:$PATH ## escボタンを押下し、コマンドモードにし、「:wq」を入力して保存してください。
source ~/.bash_profile
MySQL
# MySQLのデータファイルやログなどが格納されているディレクトリを削除する |
$ sudo rm -rf /usr/local/var/mysql |
# MySQLを再インストール |
$ brew uninstall mysql |
$ brew install mysql |
# MySQLを起動 |
$ mysql.server start |
Starting MySQL |
SUCCESS! |