1

我正在学习 ruby​​ on rails,因此需要为 app 安装一些 gem。我正在尝试安装 ruby​​-bundler 但出现错误。需要一些帮助..我将在终端中粘贴我尝试过的命令。提前致谢。

hp@ubuntu:~$ bundle install --without production
The program 'bundle' is currently not installed.  You can install it by typing:
sudo apt-get install ruby-bundler

hp@ubuntu:~$ sudo apt-get install ruby-bundler
[sudo] password for hp: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  ruby ruby1.8
Suggested packages:
ri ruby-dev ruby1.8-examples ri1.8
The following NEW packages will be installed:
  ruby ruby-bundler ruby1.8
0 upgraded, 3 newly installed, 0 to remove and 64 not upgraded.
Need to get 143 kB of archives.
After this operation, 1,139 kB of additional disk space will be used.  
Do you want to continue [Y/n]? y
Err http://ubuntuarchive.hnsdc.com/ubuntu/ oneiric/main ruby all 4.8
Unable to connect to ubuntuarchive.hnsdc.com:http:
Err http://ubuntuarchive.hnsdc.com/ubuntu/ oneiric/universe ruby-bundler all 1.0.15-     0ubuntu2
Unable to connect to ubuntuarchive.hnsdc.com:http:
Err http://ubuntuarchive.hnsdc.com/ubuntu/ oneiric-security/main ruby1.8 i386 1.8.7.352- 2ubuntu0.1
Unable to connect to ubuntuarchive.hnsdc.com:http:
Failed to fetch             http://ubuntuarchive.hnsdc.com/ubuntu/pool/main/r/ruby1.8/ruby1.8_1.8.7.352-2ubuntu0.1_i386.deb  Unable to connect to ubuntuarchive.hnsdc.com:http:
Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/pool/main/r/ruby-     defaults/ruby_4.8_all.deb  Unable to connect to ubuntuarchive.hnsdc.com:http:
Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/pool/universe/r/ruby-bundler/ruby-bundler_1.0.15-0ubuntu2_all.deb  Unable to connect to ubuntuarchive.hnsdc.com:http:
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
hp@ubuntu:~$ sudo apt-get update
Ign http://archive.canonical.com oneiric InRelease                             
Hit http://archive.canonical.com oneiric Release.gpg                           
Hit http://archive.canonical.com oneiric Release                               
Hit http://archive.canonical.com oneiric/partner i386 Packages                  
Ign http://archive.canonical.com oneiric/partner TranslationIndex              
Err http://ubuntuarchive.hnsdc.com oneiric InRelease                                                           

Err http://ubuntuarchive.hnsdc.com oneiric-updates InRelease                   

Err http://ubuntuarchive.hnsdc.com oneiric-security InRelease

Err http://ubuntuarchive.hnsdc.com oneiric Release.gpg
Unable to connect to ubuntuarchive.hnsdc.com:http:
Err http://ubuntuarchive.hnsdc.com oneiric-updates Release.gpg
Unable to connect to ubuntuarchive.hnsdc.com:http:
Err http://ubuntuarchive.hnsdc.com oneiric-security Release.gpg
Unable to connect to ubuntuarchive.hnsdc.com:http:
Ign http://archive.canonical.com oneiric/partner Translation-en_US
Ign http://archive.canonical.com oneiric/partner Translation-en
Reading package lists... Done
W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric/InRelease  

W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric-updates/InRelease  

W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric-security/InRelease  

W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric/Release.gpg      Unable to connect to ubuntuarchive.hnsdc.com:http:

W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric-updates/Release.gpg  Unable to connect to ubuntuarchive.hnsdc.com:http:

W: Failed to fetch http://ubuntuarchive.hnsdc.com/ubuntu/dists/oneiric-security/Release.gpg  Unable to connect to ubuntuarchive.hnsdc.com:http:

W: Some index files failed to download. They have been ignored, or old ones used instead.

可能是什么原因?它与ubuntu存档镜像有关吗?由于软件包损坏,我什至无法升级。

4

2 回答 2

0

您没有包含太多关于正确安装 Ruby 所做的工作,所以我会参考这篇关于在 Ubuntu 上安装 Ruby 的博客文章

使用 Ubuntu 作为开发平台时需要注意的一点是,安装本博客文章中介绍的一些开发工具和库是明智之举。

2013 年 1 月 31 日 - 如果您有未满足的包依赖项,并且您从 3rd 方源安装并收到包依赖项错误。进入您的软件源并确保未选中 Restricted 和 Universe。

未满足依赖关系的一个可能原因可能是包数据库损坏,和/或某些包没有正确安装。

要尝试解决此问题,请打开终端并运行以下命令

xyz@ubuntuhost$ sudo apt-get clean

apt-get clean 清除所有文件/包的本地存储库,只留下锁定文件。

如果不能解决您的问题,请按以下顺序尝试这三个命令。

xyz@ubuntuhost$ sudo apt-get -f install

xyz@ubuntuhost$ sudo dpkg --configure -a

xyz@ubuntuhost$ sudo apt-get -f install

发布最后一个命令的输出。如果它找到并修复了某些东西,它将报告类似

1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

或者

0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded

-f 代表“修复损坏”。Apt 将尝试纠正损坏的依赖关系。如果您手动安装了具有未满足依赖项的软件包,apt-get 将尽可能安装这些依赖项,否则它可能会简单地删除您安装的软件包以解决问题。

试一试。

于 2013-01-30T16:51:48.880 回答
0

好像你的网络有问题

于 2013-01-30T15:38:53.387 回答