简体   繁体   English

尝试在Linux Mint 19中安装ruby失败

[英]failing trying to install ruby in linux mint 19

I'm trying to install Ruby on Rails in Linux Mint 19. First of all I tried installing 我正在尝试在Linux Mint 19中安装Ruby on Rails。首先,我尝试安装

$ sudo apt install ruby-full

from the Repo. 从回购。 Then it began to complain trying to install gems or even if trying to update gems. 然后它开始抱怨尝试安装gems或什至尝试更新gems。 So I rolled back everything and tried installing Ruby from rvm. 因此,我回滚了所有内容,并尝试从rvm安装Ruby。 Here is what I did: 这是我所做的:

$ command curl -sSL https://rvm.io/mpapis.asc | gpg --import

and

$ \\curl -sSL https://get.rvm.io | bash -s stable --ruby

The first weird thing was this orange message: 第一件奇怪的事情是这个橙色消息:

    No binary rubies available for: mint/19/x86_64/ruby-2.5.1.
    Continuing with compilation. Please read 'rvm help mount' to get more information
on binary rubies.

Then another weird thing: 然后是另一件事:

Checking requirements for mint.
Installing requirements for mint.
Updating system.........There has been an error while updating your system using `apt-get`.
It seems that there are some 404 Not Found errors for repositories listed in:

    /etc/apt/sources.list
    /etc/apt/sources.list.d/*.list

Make sure that all repositories are available from your system and verify your setup by running manually:

    sudo apt-get update

Make sure that it works correctly before proceeding with RVM.

The repository is the official one that comes with the Mint installation. 该库是Mint安装随附的官方库。 And finally a red message yelling this: 最后,一条红色消息大喊:

Error running 'requirements_debian_update_system ruby-2.5.1',
please read /home/username/.rvm/log/1539700159_ruby-2.5.1/update_system.log
Requirements installation failed with status: 100.

How can I solve this? 我该如何解决?

Since I'm a newcomer into Ruby and into Rails and I'm still need to read and to research a lot more I found a valid solution: using rbenv. 由于我是Ruby和Rails的新手,我仍然需要阅读和研究更多内容,所以我找到了一个有效的解决方案:使用rbenv。

Here is what I did: 这是我所做的:

$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ exec $SHELL
$ git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
$ echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
$ exec $SHELL
$ sudo apt-get install -y libssl-dev libreadline-dev zlib1g-dev readline-doc libssl-doc
$ rbenv install 2.5.1
$ rbenv global 2.5.1
$ gem install bundler
$ rbenv rehash
$ curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$ sudo apt-get install -y nodejs
$ gem install rails -v 5.2.0
$ rbenv rehash

There is a lot of command line and some of them are repeated, but I think it worth it. 有很多命令行,其中有些是重复的,但我认为值得。 No errors, no complains, my terminal is crystal clear. 没有错误,没有抱怨,我的终端非常清晰。 Everything went like a charm. 一切都像个魅力。

Credit goes to the people in https://gorails.com . 信誉归于https://gorails.com中的人们。 I thank them and I hope this might be helpful. 我感谢他们,希望对您有所帮助。

There is nothing weird about the output of RVM, the first message is just telling that it has not found a compiled version of ruby for your specific OS(Linux Mint 19), so it will download all necessary files and compile it. RVM的输出没有什么奇怪的,第一条消息只是告诉它没有找到针对您的特定OS(Linux Mint 19)的ruby编译版本,因此它将下载所有必需的文件并进行编译。 The second message states that when trying to update the repos there where some errors, so you should manually update the system and remove/disable any non-working repo, so that installation can continue. 第二条消息指出,尝试在那里更新存储库时会出现一些错误,因此您应该手动更新系统并删除/禁用所有无效的存储库,以便继续安装。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM