我正在尝试在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中的人们。我感谢他们,希望对您有所帮助。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句