我正在我的Ubuntu 14.04 DigitalOcean Droplet上干净地安装rails环境。所以我做了
gem install bundler
这是我回来的奇怪的事情
me@droplet:~$ gem install bundler
ERROR: Could not find a valid gem '//' (>= 0) in any repository
ERROR: Could not find a valid gem 'Rubygems' (>= 0) in any repository
ERROR: Possible alternatives: ruby_gem, cf_ruby_gems, eyrubygems, ruby-des, ruby-rets
ERROR: Could not find a valid gem 'will' (>= 0) in any repository
ERROR: Possible alternatives: bill, dill, fill, gill, jill
Fetching: not-0.0.1.gem (100%)
Successfully installed not-0.0.1
ERROR: Could not find a valid gem 'install' (>= 0) in any repository
ERROR: Possible alternatives: installr, instant, instapi, ptinstall, stall
Fetching: execjs-2.6.0.gem (100%)
Successfully installed execjs-2.6.0
Fetching: uglifier-2.7.2.gem (100%)
Successfully installed uglifier-2.7.2
Fetching: tilt-2.0.2.gem (100%)
Successfully installed tilt-2.0.2
Fetching: rack-1.6.4.gem (100%)
Successfully installed rack-1.6.4
Fetching: concurrent-ruby-1.0.2.gem (100%)
Successfully installed concurrent-ruby-1.0.2
Fetching: sprockets-3.6.0.gem (100%)
Successfully installed sprockets-3.6.0
Fetching: thread_safe-0.3.5.gem (100%)
Successfully installed thread_safe-0.3.5
Fetching: tzinfo-1.2.2.gem (100%)
Successfully installed tzinfo-1.2.2
Fetching: i18n-0.7.0.gem (100%)
Successfully installed i18n-0.7.0
Fetching: activesupport-4.2.6.gem (100%)
Successfully installed activesupport-4.2.6
Fetching: mini_portile2-2.0.0.gem (100%)
Successfully installed mini_portile2-2.0.0
Fetching: nokogiri-1.6.7.2.gem (100%)
Building native extensions. This could take a while...
Successfully installed nokogiri-1.6.7.2
Fetching: loofah-2.0.3.gem (100%)
Successfully installed loofah-2.0.3
Fetching: rails-html-sanitizer-1.0.3.gem (100%)
Successfully installed rails-html-sanitizer-1.0.3
Fetching: rails-deprecated_sanitizer-1.0.3.gem (100%)
Successfully installed rails-deprecated_sanitizer-1.0.3
Fetching: rails-dom-testing-1.0.7.gem (100%)
Successfully installed rails-dom-testing-1.0.7
Fetching: rack-test-0.6.3.gem (100%)
Successfully installed rack-test-0.6.3
Fetching: erubis-2.7.0.gem (100%)
Successfully installed erubis-2.7.0
Fetching: builder-3.2.2.gem (100%)
Successfully installed builder-3.2.2
Fetching: actionview-4.2.6.gem (100%)
Successfully installed actionview-4.2.6
Fetching: actionpack-4.2.6.gem (100%)
Successfully installed actionpack-4.2.6
Fetching: sprockets-rails-3.0.4.gem (100%)
Successfully installed sprockets-rails-3.0.4
Fetching: sass-3.4.22.gem (100%)
Successfully installed sass-3.4.22
Fetching: thor-0.19.1.gem (100%)
Successfully installed thor-0.19.1
Fetching: railties-4.2.6.gem (100%)
Successfully installed railties-4.2.6
Fetching: sass-rails-5.0.4.gem (100%)
Successfully installed sass-rails-5.0.4
Fetching: redcarpet-3.3.4.gem (100%)
Building native extensions. This could take a while...
Successfully installed redcarpet-3.3.4
Fetching: bundler-1.12.3.gem (100%)
Successfully installed bundler-1.12.3
Fetching: arel-6.0.3.gem (100%)
Successfully installed arel-6.0.3
Fetching: activemodel-4.2.6.gem (100%)
Successfully installed activemodel-4.2.6
Fetching: activerecord-4.2.6.gem (100%)
Successfully installed activerecord-4.2.6
Fetching: globalid-0.3.6.gem (100%)
Successfully installed globalid-0.3.6
Fetching: activejob-4.2.6.gem (100%)
Successfully installed activejob-4.2.6
Fetching: mime-types-data-3.2016.0221.gem (100%)
Successfully installed mime-types-data-3.2016.0221
Fetching: mime-types-3.0.gem (100%)
Successfully installed mime-types-3.0
Fetching: mail-2.6.4.gem (100%)
Successfully installed mail-2.6.4
Fetching: actionmailer-4.2.6.gem (100%)
Successfully installed actionmailer-4.2.6
Fetching: rails-4.2.6.gem (100%)
Successfully installed rails-4.2.6
Fetching: yajl-ruby-1.2.1.gem (100%)
Building native extensions. This could take a while...
Successfully installed yajl-ruby-1.2.1
Fetching: posix-spawn-0.3.11.gem (100%)
Building native extensions. This could take a while...
Successfully installed posix-spawn-0.3.11
Fetching: pygments.rb-0.6.3.gem (100%)
Successfully installed pygments.rb-0.6.3
Fetching: nifty-dialog-1.1.1.gem (100%)
Successfully installed nifty-dialog-1.1.1
Fetching: nifty-attachments-1.0.4.gem (100%)
Successfully installed nifty-attachments-1.0.4
Fetching: jquery-rails-4.1.1.gem (100%)
Successfully installed jquery-rails-4.1.1
Fetching: haml-4.0.7.gem (100%)
HEADS UP! Haml 4.0 has many improvements, but also has changes that may break
your application:
* Support for Ruby 1.8.6 dropped
* Support for Rails 2 dropped
* Sass filter now always outputs <style> tags
* Data attributes are now hyphenated, not underscored
* html2haml utility moved to the html2haml gem
* Textile and Maruku filters moved to the haml-contrib gem
For more info see:
http://rubydoc.info/github/haml/haml/file/CHANGELOG.md
Successfully installed haml-4.0.7
Fetching: dynamic_form-1.1.4.gem (100%)
Successfully installed dynamic_form-1.1.4
Fetching: coffee-script-source-1.10.0.gem (100%)
Successfully installed coffee-script-source-1.10.0
Fetching: coffee-script-2.4.1.gem (100%)
Successfully installed coffee-script-2.4.1
Fetching: coffee-rails-4.1.1.gem (100%)
Successfully installed coffee-rails-4.1.1
Fetching: documentation-1.0.9.gem (100%)
Successfully installed documentation-1.0.9
Successfully installed bundler-1.12.3
52 gems installed
我没有太多经验,但我以前从未见过这样的行为。这些错误在开始时是什么以及为什么安装所有这些宝石?
所以我决定也许是因为新的Ruby版本2.3.1有些宝石还不支持它或类似的东西。我在我的本地机器上检查了它,它给了我完全不同的结果:
me@bounty:~$ gem install bundler
Fetching: bundler-1.12.3.gem (100%)
Successfully installed bundler-1.12.3
1 gem installed
所以我对这种不同的本地/服务器行为来自何处感兴趣?
这是另一件我不明白的事情。如果我继续在我的服务器上运行此命令,我会得到另一个结果:
me@droplet:~$ gem install bundler
ERROR: Could not find a valid gem '//' (>= 0) in any repository
ERROR: Could not find a valid gem 'Rubygems' (>= 0) in any repository
ERROR: Possible alternatives: ruby_gem, cf_ruby_gems, eyrubygems, ruby-des, ruby-rets
ERROR: Could not find a valid gem 'will' (>= 0) in any repository
ERROR: Possible alternatives: bill, dill, fill, gill, jill
Successfully installed not-0.0.1
ERROR: Could not find a valid gem 'install' (>= 0) in any repository
ERROR: Possible alternatives: installr, instant, instapi, ptinstall, stall
Successfully installed documentation-1.0.9
Successfully installed bundler-1.12.3
3 gems installed
me@droplet:~$ gem install bundler
ERROR: Could not find a valid gem '//' (>= 0) in any repository
ERROR: Could not find a valid gem 'Rubygems' (>= 0) in any repository
ERROR: Possible alternatives: ruby_gem, cf_ruby_gems, eyrubygems, ruby-des, ruby-rets
ERROR: Could not find a valid gem 'will' (>= 0) in any repository
ERROR: Possible alternatives: bill, dill, fill, gill, jill
Successfully installed not-0.0.1
ERROR: Could not find a valid gem 'install' (>= 0) in any repository
ERROR: Possible alternatives: installr, instant, instapi, ptinstall, stall
Successfully installed documentation-1.0.9
Successfully installed bundler-1.12.3
3 gems installed
为什么要继续安装这三颗宝石?
我是一个完全新手,我可能错过了一些重要的东西。所以请告诉我你是否希望我提供有关此事的任何其他信息。
更新1
然后我继续这样做:
me@droplet:~$ sudo add-apt-repository ppa:chris-lea/node.js
me@droplet:~$ sudo apt-get update
Get:1 http://security.ubuntu.com trusty-security InRelease [65.9 kB]
Ign http://ppa.launchpad.net trusty InRelease
Get:2 http://ppa.launchpad.net trusty Release.gpg [316 B]
Get:3 http://ppa.launchpad.net trusty Release [15.1 kB]
Get:4 http://security.ubuntu.com trusty-security/main Sources [113 kB]
Ign http://mirrors.digitalocean.com trusty InRelease
Get:5 http://ppa.launchpad.net trusty/main i386 Packages [758 B]
Get:6 http://ppa.launchpad.net trusty/main Translation-en [604 B]
Get:7 http://security.ubuntu.com trusty-security/universe Sources [36.2 kB]
Hit http://mirrors.digitalocean.com trusty-updates InRelease
Get:8 http://security.ubuntu.com trusty-security/main i386 Packages [436 kB]
Get:9 http://security.ubuntu.com trusty-security/universe i386 Packages [127 kB]
Hit http://mirrors.digitalocean.com trusty-backports InRelease
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Hit http://mirrors.digitalocean.com trusty Release.gpg
Hit http://mirrors.digitalocean.com trusty-updates/main Sources
Hit http://mirrors.digitalocean.com trusty-updates/restricted Sources
Hit http://mirrors.digitalocean.com trusty-updates/universe Sources
Hit http://mirrors.digitalocean.com trusty-updates/multiverse Sources
Hit http://mirrors.digitalocean.com trusty-updates/main i386 Packages
Hit http://mirrors.digitalocean.com trusty-updates/restricted i386 Packages
Hit http://mirrors.digitalocean.com trusty-updates/universe i386 Packages
Hit http://mirrors.digitalocean.com trusty-updates/multiverse i386 Packages
Hit http://mirrors.digitalocean.com trusty-updates/main Translation-en
Hit http://mirrors.digitalocean.com trusty-updates/multiverse Translation-en
Hit http://mirrors.digitalocean.com trusty-updates/restricted Translation-en
Hit http://mirrors.digitalocean.com trusty-updates/universe Translation-en
Hit http://mirrors.digitalocean.com trusty-backports/main Sources
Hit http://mirrors.digitalocean.com trusty-backports/restricted Sources
Hit http://mirrors.digitalocean.com trusty-backports/universe Sources
Hit http://mirrors.digitalocean.com trusty-backports/multiverse Sources
Hit http://mirrors.digitalocean.com trusty-backports/main i386 Packages
Hit http://mirrors.digitalocean.com trusty-backports/restricted i386 Packages
Hit http://mirrors.digitalocean.com trusty-backports/universe i386 Packages
Hit http://mirrors.digitalocean.com trusty-backports/multiverse i386 Packages
Hit http://mirrors.digitalocean.com trusty-backports/main Translation-en
Hit http://mirrors.digitalocean.com trusty-backports/multiverse Translation-en
Hit http://mirrors.digitalocean.com trusty-backports/restricted Translation-en
Hit http://mirrors.digitalocean.com trusty-backports/universe Translation-en
Hit http://mirrors.digitalocean.com trusty Release
Hit http://mirrors.digitalocean.com trusty/main Sources
Hit http://mirrors.digitalocean.com trusty/restricted Sources
Hit http://mirrors.digitalocean.com trusty/universe Sources
Hit http://mirrors.digitalocean.com trusty/multiverse Sources
Hit http://mirrors.digitalocean.com trusty/main i386 Packages
Hit http://mirrors.digitalocean.com trusty/restricted i386 Packages
Hit http://mirrors.digitalocean.com trusty/universe i386 Packages
Hit http://mirrors.digitalocean.com trusty/multiverse i386 Packages
Hit http://mirrors.digitalocean.com trusty/main Translation-en
Hit http://mirrors.digitalocean.com trusty/multiverse Translation-en
Hit http://mirrors.digitalocean.com trusty/restricted Translation-en
Hit http://mirrors.digitalocean.com trusty/universe Translation-en
Ign http://mirrors.digitalocean.com trusty/main Translation-en_US
Ign http://mirrors.digitalocean.com trusty/multiverse Translation-en_US
Ign http://mirrors.digitalocean.com trusty/restricted Translation-en_US
Ign http://mirrors.digitalocean.com trusty/universe Translation-en_US
Fetched 795 kB in 16s (48.6 kB/s)
Reading package lists... Done
me@droplet:~$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
rlwrap
The following NEW packages will be installed:
nodejs rlwrap
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,394 kB of archives.
After this operation, 18.2 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirrors.digitalocean.com/ubuntu/ trusty/universe rlwrap i386 0.37-5 [72.3 kB]
Get:2 http://ppa.launchpad.net/chris-lea/node.js/ubuntu/ trusty/main nodejs i386 0.10.37-1chl1~trusty1 [4,321 kB]
Fetched 4,394 kB in 2s (1,484 kB/s)
Selecting previously unselected package rlwrap.
(Reading database ... 65726 files and directories currently installed.)
Preparing to unpack .../rlwrap_0.37-5_i386.deb ...
Unpacking rlwrap (0.37-5) ...
Selecting previously unselected package nodejs.
Preparing to unpack .../nodejs_0.10.37-1chl1~trusty1_i386.deb ...
Unpacking nodejs (0.10.37-1chl1~trusty1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up rlwrap (0.37-5) ...
update-alternatives: using /usr/bin/rlwrap to provide /usr/bin/readline-editor (readline-editor) in auto mode
Setting up nodejs (0.10.37-1chl1~trusty1) ...
然后我再次尝试安装bundler,这没关系:
me@droplet:~$ gem install bundler
Successfully installed bundler-1.12.3
1 gem installed
但我不明白为什么。发生了什么事?