简体   繁体   English

Ruby on Rails安装失败

[英]Ruby on Rails Install Fails

I am trying to get set up using rbenv and ruby on rails. 我正在尝试使用rbenv和ruby在rails上进行设置。 Everything has been working fine (been working through Lynda.com Ruby on Rails Essential Training) until it came time to actually install the rails gem. 一切工作正常(通过Lynda.com Ruby on Rails Essential Training进行工作),直到真正安装Rails gem为止。 It fails in the sam way every time. 每次都失败。 Can someone tell me what I need to do to continue with Rails? 有人可以告诉我继续使用Rails需要做什么吗?

I've used rbenv and have been set up with Ruby 2.1.1. 我使用过rbenv并已使用Ruby 2.1.1进行了设置。

Provided Terminal Screenshot 提供的终端截图

Edit: I am calling sudo because when I try to install without sudo it provides the following (folder permissions provided for context) 编辑:我正在调用sudo,因为当我尝试不使用sudo进行安装时,它会提供以下内容(为上下文提供了文件夹权限) 在此处输入图片说明

Assuming you have a working rbenv installation with 2.1.1 installed, you should just be able to remove sudo from the command: 假设您已经安装了2.1.1且可以正常工作的rbenv安装,那么您应该能够从命令中删除sudo

gem install rails --no-rdoc --no-ri

Using sudo runs as root, which knows nothing of the local rbenv installation for your mattcoker user, so it uses the system's Ruby instead. 使用sudo作为root运行,它对您的mattcoker用户mattcoker本地rbenv安装,因此它改用系统的Ruby。 Generally, when using rbenv locally on your machine, you should never need to use sudo . 通常,在计算机上本地使用rbenv时,您永远不需要使用sudo

I never actually set the local ruby version with rbenv local 2.1.1 . 我从未真正使用rbenv local 2.1.1设置本地ruby版本。 Everything worked like a charm after that. 在那之后,一切都像魅力一样。

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

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