我正在尝试在我的Ubuntu 12.04上使用命令“gem install rails”安装Rails。我已经在我的apt.conf文件中配置了用户名、密码和代理详细信息。然而,执行此命令时出现以下错误:“ERROR: While executing gem ... (Net::HTTPServerException) 407 "Proxy Authentication Required"”。如果我运行“sudo gem install rails”,则会出现以下错误:“ERROR: While executing gem ... (Gem::DependencyError) Unable to resolve dependencies: treetop requires polyglot (>= 0), polyglot (>= 0.3.1); sprockets requires tilt (!= 1.3.0, ~> 1.1)”。我的本地gem列表如下:
* 本地宝石库 * actionmailer (4.0.1) actionpack (4.0.1) activemodel (4.0.1) activerecord (4.0.1) activerecord-deprecated_finders (1.0.3) activesupport (4.0.1) arel (4.0.1) atomic (1.1.14) bigdecimal (1.2.0) builder (3.1.4) bundler (1.3.5) bundler-unload (1.0.2) coffee-rails (4.0.1) coffee-script (2.2.0) coffee-script-source (1.6.3) erubis (2.7.0) execjs (2.0.2) executable-hooks (1.2.6) hike (1.2.3) i18n (0.6.5) io-console (0.4.2) jbuilder (1.5.2) jquery-rails (3.0.4) json (1.8.1, 1.7.7) mail (2.5.4) mime-types (1.25) minitest (4.7.5, 4.3.2) multi_json (1.8.2) polyglot (0.3.3) psych (2.0.0) rack (1.5.2) rack-test (0.6.2) rails (4.0.1) railties (4.0.1) rake (10.1.0, 0.9.6) rdoc (4.0.1, 4.0.0, 3.12.2) rubygems-bundler (1.4.2) rvm (1.11.3.8) sass (3.2.12) sass-rails (4.0.1) sdoc (0.3.20) sprockets (2.10.0) sprockets-rails (2.0.1) sqlite3 (1.3.8) test-unit (2.0.0.0) thor (0.18.1) thread_safe (0.1.3) tilt (1.4.1) treetop (1.4.15) turbolinks (1.3.0) tzinfo (0.3.38) uglifier (2.3.0)
我已经运行了 "rvm requirements" 命令,我也尝试使用 SET HTTP_PROXY 命令,但似乎并没有任何影响。我该怎么办?
编辑:
我尝试使用
export http_proxy=http://${username}:${password}@${proxy}:${port}
然后运行 gem install rails 就成功了...
* 本地宝石库 * actionmailer (4.0.1) actionpack (4.0.1) activemodel (4.0.1) activerecord (4.0.1) activerecord-deprecated_finders (1.0.3) activesupport (4.0.1) arel (4.0.1) atomic (1.1.14) bigdecimal (1.2.0) builder (3.1.4) bundler (1.3.5) bundler-unload (1.0.2) coffee-rails (4.0.1) coffee-script (2.2.0) coffee-script-source (1.6.3) erubis (2.7.0) execjs (2.0.2) executable-hooks (1.2.6) hike (1.2.3) i18n (0.6.5) io-console (0.4.2) jbuilder (1.5.2) jquery-rails (3.0.4) json (1.8.1, 1.7.7) mail (2.5.4) mime-types (1.25) minitest (4.7.5, 4.3.2) multi_json (1.8.2) polyglot (0.3.3) psych (2.0.0) rack (1.5.2) rack-test (0.6.2) rails (4.0.1) railties (4.0.1) rake (10.1.0, 0.9.6) rdoc (4.0.1, 4.0.0, 3.12.2) rubygems-bundler (1.4.2) rvm (1.11.3.8) sass (3.2.12) sass-rails (4.0.1) sdoc (0.3.20) sprockets (2.10.0) sprockets-rails (2.0.1) sqlite3 (1.3.8) test-unit (2.0.0.0) thor (0.18.1) thread_safe (0.1.3) tilt (1.4.1) treetop (1.4.15) turbolinks (1.3.0) tzinfo (0.3.38) uglifier (2.3.0)
我已经运行了 "rvm requirements" 命令,我也尝试使用 SET HTTP_PROXY 命令,但似乎并没有任何影响。我该怎么办?
编辑:
我尝试使用
export http_proxy=http://${username}:${password}@${proxy}:${port}
然后运行 gem install rails 就成功了...
sudo gem install rails
怎么样? - sawa