[英]failing trying to install ruby in linux mint 19
我正在嘗試在Linux Mint 19中安裝Ruby on Rails。首先,我嘗試安裝
$ sudo apt install ruby-full
從回購。 然后它開始抱怨嘗試安裝gems或什至嘗試更新gems。 因此,我回滾了所有內容,並嘗試從rvm安裝Ruby。 這是我所做的:
$ command curl -sSL https://rvm.io/mpapis.asc | gpg --import
和
$ \\curl -sSL https://get.rvm.io | bash -s stable --ruby
第一件奇怪的事情是這個橙色消息:
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.
然后是另一件事:
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.
該庫是Mint安裝隨附的官方庫。 最后,一條紅色消息大喊:
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.
我該如何解決?
由於我是Ruby和Rails的新手,我仍然需要閱讀和研究更多內容,所以我找到了一個有效的解決方案:使用rbenv。
這是我所做的:
$ 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
有很多命令行,其中有些是重復的,但我認為值得。 沒有錯誤,沒有抱怨,我的終端非常清晰。 一切都像個魅力。
信譽歸於https://gorails.com中的人們。 我感謝他們,希望對您有所幫助。
RVM的輸出沒有什么奇怪的,第一條消息只是告訴它沒有找到針對您的特定OS(Linux Mint 19)的ruby編譯版本,因此它將下載所有必需的文件並進行編譯。 第二條消息指出,嘗試在那里更新存儲庫時會出現一些錯誤,因此您應該手動更新系統並刪除/禁用所有無效的存儲庫,以便繼續安裝。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.