English 中文(简体)
在安装铁路时,我如何确定“你在安装铁路时没有书面许可”。
原标题:How do I fix the "You don t have write permissions into the /usr/bin directory" error when installing Rails?

我试图将铁路3安装在新品牌的MacBook Pro经管的OS X 10.6.3、Ruby 1.8.7和铁路2.3.5和I m想知道,我是否亲爱。 到目前为止,我已掌握这些指挥:

$ gem update --system
$ gem install arel tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler i18n
$ gem install rails --pre

然而,当我上任时,我发现这一错误:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don t have write permissions into the /usr/bin directory.

我认为,我想我用<编码>sudo指挥。 从而可在<代码>/usr/bin/rails上书写。 但是,如果我这样做的话,我就得胜过我的铁路。 我不想这样做。 相反,我要保留两种铁路。 我如何这样做?

最佳回答

d 我建议使用RVM,允许有多种版本的Ruby/Rails安装有gem剖面,基本上保持了你相互控制的所有宝石。 你不妨检查一个类似的员额:。 • 我如何在OSX上的铁路3上安装Rub。

问题回答

使用<条码>-n参数,用于像可可豆一样安装:

sudo gem install cocoapods -n /usr/local/bin

利用-n /usr/ local/bin国旗有效, BUT 我每次想再次更新一揽子计划时,都必须回到这个网页上。 因此,我列举了这方面的永久解决办法。

有兴趣确定<>永久的人:

创建~/.gemrc文档

vim .gemrc

内容如下:

:gemdir:
   - ~/.gem/ruby
install: -n /usr/local/bin

现在,你可以正常地在没有国旗的情况下指挥你。

欢乐!

sudo gem install cocoapods --pre -n /usr/local/bin

这为我工作。

页: 1

这为我工作。

为了纠正你的具体错误,你需要把这一指挥作为代号,即:

sudo gem install rails --pre

在马科斯高地,解决了我的问题:

sudo gem update --system -n /usr/local/bin/gem




相关问题
Remove ActiveRecord in Rails 3

Now that Rails 3 beta is out, I thought I d have a look at rewriting an app I have just started work on in Rails 3 beta, both to get a feel for it and get a bit of a head-start. The app uses MongoDB ...

When will you upgrade your app to Rails 3? [closed]

Now that the Rails 3 beta is here, let s take a little straw poll. Please tell us briefly what your application does and when you will upgrade it to Rails 3. Or, if you re not planning on upgrading ...

Bundler isn t loading gems

I have been having a problem with using Bundler and being able to access my gems without having to require them somewhere, as config.gem used to do that for me (as far as I know). In my Rails 3 app, I ...

bypass attr_accessible/protected in rails

I have a model that, when it instantiates an object, also creates another object with the same user id. class Foo > ActiveRecord::Base after_create: create_bar private def create_bar Bar....

concat two fields activerecord

I m so used to oracle where you can simply concat(field1, , field2) but if I m using activerecord to find the field1 and field2, and I need a space in between, how do I accomplish this? Cheers ...