无法在窗口 10 上使用 ubuntu 的 bash 通过 rbenv 安装 ruby



我正在尝试在窗口 10 上安装 ruby,但遇到了一些问题。

首先,我按照说明安装了 ubuntu 的 bash,但在控制面板上添加了"sublinux 系统"选项并重新安装后,bash 根本不起作用。当我点击它时,它就会立即关闭。所以我在Microsoft商店下载了 linux 应用程序,并继续说明,然后我被 ruby 安装卡住了。

   minhtam@DESKTOP-KJ2L9J7:~$ rbenv install 2.6.3  
   Downloading ruby-2.6.3.tar.bz2...                                                                                                                                       
   -> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.bz2                                                                                                          
   Installing ruby-2.6.3...                                                                                                                                                                                                                                                                                                                        
   BUILD FAILED (Ubuntu 18.04 using ruby-build 20190615-1-g0867187)                                                                                                                                                                                                                                                                                
   Inspect or clean up the working tree at /tmp/ruby- 
   build.20190618055333.4192                                                                                             
   Results logged to /tmp/ruby-build.20190618055333.4192.log                                                                                                                                                                                                                                                                                       
   Last 10 log lines:                                                                                                                                                      
   checking for ruby... false                                                                                                                                              
   checking build system type... x86_64-pc-linux-gnu                                                                                                                       
   checking host system type... x86_64-pc-linux-gnu                                                                                                                        
   checking target system type... x86_64-pc-linux-gnu                                                                                                                      
   checking for gcc... no                                                                                                                                                  
   checking for cc... no                                                                                                                                                   
   checking for cl.exe... no                                                                                                                                               
   configure: error: in `/tmp/ruby-build.20190618055333.4192/ruby-2.6.3':                                                                                                  
   configure: error: no acceptable C compiler found in $PATH                                                                                                               
   See `config.log' for more details  

我已经在寻找解决方案并安装了libssl-dev,但它没有任何帮助。

你可能想试试

sudo apt-get install gcc

如果不起作用,请尝试本主题

总结一下

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

另外,我想在这里分享我在Windows上安装和使用RoR和Mysql的经验

最新更新