我无法在 Leopard 中安装任何 gem 或更新

发布于 2024-09-28 23:56:59 字数 1455 浏览 5 评论 0原文

bogon:~ Zhulin$ ruby -v
ruby 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]
bogon:~ Zhulin$ rails -v
Rails 1.2.6
bogon:~ Zhulin$ gems -v
-bash: gems: command not found
bogon:~ Zhulin$ sudo gem install heroku
Password:
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml
bogon:~ Zhulin$ gem -v
1.0.1
bogon:~ Zhulin$ gem list

*** LOCAL GEMS ***

actionmailer (1.3.6)
actionpack (1.13.6)
actionwebservice (1.2.6)
activerecord (1.15.6)
activesupport (1.4.4)
acts_as_ferret (0.4.1)
capistrano (2.0.0)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.9)
dnssd (0.6.0)
fastthread (1.0.1)
fcgi (0.8.7)
ferret (0.11.4)
gem_plugin (0.2.3)
highline (1.2.9)
hpricot (0.6)
libxml-ruby (0.9.5, 0.3.8.4)
mongrel (1.1.4)
needle (1.3.0)
net-sftp (1.1.0)
net-ssh (1.1.2)
rails (1.2.6)
rake (0.7.3)
RedCloth (3.0.4)
ruby-openid (1.1.4)
ruby-yadis (0.3.4)
rubynode (0.1.3)
sqlite3-ruby (1.2.1)
termios (0.9.4)
bogon:~ Zhulin$ gem -update
ERROR:  Invalid option: -update.  See 'gem --help'.
bogon:~ Zhulin$ gem update --system
Updating RubyGems...
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml
bogon:~ Zhulin$ gem install rubygems-update
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml
bogon:~ Zhulin$ 

任何人都可以帮我弄清楚吗?

bogon:~ Zhulin$ ruby -v
ruby 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]
bogon:~ Zhulin$ rails -v
Rails 1.2.6
bogon:~ Zhulin$ gems -v
-bash: gems: command not found
bogon:~ Zhulin$ sudo gem install heroku
Password:
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml
bogon:~ Zhulin$ gem -v
1.0.1
bogon:~ Zhulin$ gem list

*** LOCAL GEMS ***

actionmailer (1.3.6)
actionpack (1.13.6)
actionwebservice (1.2.6)
activerecord (1.15.6)
activesupport (1.4.4)
acts_as_ferret (0.4.1)
capistrano (2.0.0)
cgi_multipart_eof_fix (2.5.0)
daemons (1.0.9)
dnssd (0.6.0)
fastthread (1.0.1)
fcgi (0.8.7)
ferret (0.11.4)
gem_plugin (0.2.3)
highline (1.2.9)
hpricot (0.6)
libxml-ruby (0.9.5, 0.3.8.4)
mongrel (1.1.4)
needle (1.3.0)
net-sftp (1.1.0)
net-ssh (1.1.2)
rails (1.2.6)
rake (0.7.3)
RedCloth (3.0.4)
ruby-openid (1.1.4)
ruby-yadis (0.3.4)
rubynode (0.1.3)
sqlite3-ruby (1.2.1)
termios (0.9.4)
bogon:~ Zhulin$ gem -update
ERROR:  Invalid option: -update.  See 'gem --help'.
bogon:~ Zhulin$ gem update --system
Updating RubyGems...
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml
bogon:~ Zhulin$ gem install rubygems-update
ERROR:  While executing gem ... (Gem::RemoteSourceException)
    HTTP Response 302 fetching http://gems.rubyforge.org/yaml
bogon:~ Zhulin$ 

Anyone can help me figure it out?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

悲凉≈ 2024-10-05 23:56:59

我真的非常推荐使用 RVM 来安装新版本的 Ruby。 RVM 会将目标 Ruby 以及相关的 gem 放入您的主目录中的一个漂亮的沙箱中,并且您不必扰乱 Ruby 的系统安装。如果您决定稍后删除它,只需删除一个目录即可。尝试使用修改后的系统安装,看看会发生什么。 :-)

破坏系统有时是安全的,有时是坏的/危险的/致命的,这取决于它所依赖的是什么。走 RVM 路线时,您编写的代码将依赖于沙箱中的 Ruby。此外,您不需要以 sudo 身份运行,因此您的安装不易出错。

RVM 位于:rvm.beginrescueend.com。请务必按照安装页面上的说明进行操作。

I really, really, recommend using RVM to install new versions of Ruby. RVM will put the target Ruby, plus associated gems, into a nice sandbox in your home directory, and you won't have to mess with your system installation of Ruby. If you decide to delete it at a later time it's a simple matter of deleting one directory. Try that with a modified system installation and see what happens. :-)

Messing with the system is sometimes safe, sometimes bad/dangerous/fatal, depending on what relies on it. Going the RVM route only code you write will be relying on the Ruby in your sandbox. In addition you will not need to run as sudo, so your installs are less error prone.

RVM is available at: rvm.beginrescueend.com. Be sure to follow the instructions on the installation page.

沫尐诺 2024-10-05 23:56:59

如果您有 Leopard,您可能可以将 Ruby 1.8.7 与 Rails 2.3.10 结合使用。

更新您的 Ruby,然后

gem update --system

(或者您可能需要从 http://rubyforge.org/ 下载 RubyGems 1.3.7 items/rubygems/ 解压,然后运行 ​​ruby setup.rb 获取)

之后,命令可以是

gem list
gem list -r rails
gem list -r rails$
gem list -rad rails$   <-- list all rails, with description, remotely
gem install haml
gem i fastercsv        <-- 'i' is a shorthand for install

gem i rails --no-rdoc --no-ri    <-- if you install a lot of gems by creating 
                                     different gemsets using RVM, and don't want 
                                     the docs every time

sudo gem i sqlite3-ruby          <-- on some systems, the sudo is needed, but if
                                     using RVM and you are not dealing with "system"
                                     gems, the recommendation is don't use "sudo"

If you have Leopard, you probably can use Ruby 1.8.7 with Rails 2.3.10.

Update your Ruby, and then

gem update --system

(or you might need to download RubyGems 1.3.7 from http://rubyforge.org/projects/rubygems/ unpack it, and run ruby setup.rb to get it)

After that, the commands can be

gem list
gem list -r rails
gem list -r rails$
gem list -rad rails$   <-- list all rails, with description, remotely
gem install haml
gem i fastercsv        <-- 'i' is a shorthand for install

gem i rails --no-rdoc --no-ri    <-- if you install a lot of gems by creating 
                                     different gemsets using RVM, and don't want 
                                     the docs every time

sudo gem i sqlite3-ruby          <-- on some systems, the sudo is needed, but if
                                     using RVM and you are not dealing with "system"
                                     gems, the recommendation is don't use "sudo"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文