**つい先日までruby および ruby on rails で学習していたのですが、OSをアップデートしたところおかしくなってしまいました。
$ rails server ・・・とターミナルに打ち込んでみたところ、***
__zsh: /usr/local/bin/rails: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: no such file or directory
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と打ち込んだところ・・・
Building native extensions. This could take a while...
ERROR: Error installing rails:
ERROR: Failed to build gem native extension.
current directory: /Library/Ruby/Gems/2.6.0/gems/nio4r-2.5.2/ext/nio4r
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20191020-1989-1908uua.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/include/ruby.h
You might have to install separate package for the ruby development
environment, ruby-dev or ruby-devel for example.
extconf failed, exit code 1
Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/nio4r-2.5.2 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/nio4r-2.5.2/gem_make.out
・・・と出てしまいます。そこで・・・
gem install rails -v "5.2.3"・・・と打ち込みますと、
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
・・・が出てきてしまいます。
僕のRailsはどこに行ってしまったのでしょうか?
どなたか復旧方法をご教示いただけますと幸いです。
回答2件
あなたの回答
tips
プレビュー