通过RVM使用gem安装Rails时出现权限错误
我正在尝试通过 RVM 使用 Rubygems 安装 Rails。运行命令 gem install Rails -v 3.2.0
时,我收到错误:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/share/ruby-rvm/gems/ruby-1.9.3-p0 directory.
我不想使用 sudo
运行它,因为 RVM 的网站特别建议不要这样做。有什么想法为什么我可能会收到此错误以及如何解决它?
详细信息:
- RVM 版本 1.10.2
- Ruby 版本 1.9.3
- Ubuntu 版本 11.10
I'm trying to install Rails using Rubygems via RVM. When running the command gem install rails -v 3.2.0
, I receive the error:
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions into the /usr/share/ruby-rvm/gems/ruby-1.9.3-p0 directory.
I don't want to run it with sudo
because RVM's website specifically advises against that. Any thoughts why I may be getting this error and how to get around it?
Details:
- RVM version 1.10.2
- Ruby version 1.9.3
- Ubuntu version 11.10
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为问题是在安装rvm和ruby之后你应该发出这个命令
之后你安装了没有任何版本的rails并且不用担心
安装RVM之后每次创建单独的
项目时都会创建gemset目录。例如,您创建应用程序博客。首先你通过给出
这个命令创建 gemset 目录,如果你想要这个应用程序的某些特定版本的 Rails 将其写到
gem 文件中
,那么你应该使用这个 gemset 目录以及 ruby 版本,例如你已经安装了 ruby 1.9.2 然后使用此命令
之后进入博客应用程序的目录并安装此 gem
,然后捆绑安装。这样所有本地gem都会安装到
rvm下的这个博客目录中,不会出现冲突,并且还会
根据gemfile检查rails版本。
I think the problem is that after installing rvm and ruby you should issue this command
After that you install rails without any version and don't worry about it
After installing RVM create gemset directory every time whenever you create separate
project. e.g you create application blog. first you create gemset directory with giving
this command and if you want some sepecific version of rails for this application write it
down to gem file
then you should use this gemset directory and also ruby version as well e.g you have install ruby 1.9.2 then use this command
after that go into directory of blog application and install this gem
and also then bundle install. so all local gem will be installed into this blog directory
under rvm and there will be no conflicts will be appear And also check the rails version it
will be according to gemfile.