一切顺利,直到安装轨道的命令
gem install rails
我收到此错误:
ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
no such name (http://api.rubygems.org/api/v1/dependencies?gems=activerecord-deprecated_finders)
每次尝试错误消息时都会显示不同的 gem 依赖项?gems=.......
对这个问题有什么建议吗?
编辑:
这是执行 coomand 后的完整堆栈跟踪gem install rails -V
HEAD https://api.rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET https://api.rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
HEAD http://api.rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
HEAD http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET http://api.rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
GET http://production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
HEAD https://api.rubygems.org/api/v1/dependencies
302 Moved Temporarily
HEAD https://bundler.rubygems.org/api/v1/dependencies
200 OK
HEAD http://api.rubygems.org/api/v1/dependencies
302 Moved Temporarily
HEAD http://bundler.rubygems.org/api/v1/dependencies
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=rails
302 Moved Temporarily
GET https://bundler.rubygems.org/api/v1/dependencies?gems=rails
200 OK
GET http://api.rubygems.org/api/v1/dependencies?gems=rails
302 Moved Temporarily
GET http://bundler.rubygems.org/api/v1/dependencies?gems=rails
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=railties
302 Moved Temporarily
GET https://bundler.rubygems.org/api/v1/dependencies?gems=railties
200 OK
GET http://api.rubygems.org/api/v1/dependencies?gems=railties
302 Moved Temporarily
GET http://bundler.rubygems.org/api/v1/dependencies?gems=railties
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=actionmailer
302 Moved Temporarily
GET https://bundler.rubygems.org/api/v1/dependencies?gems=actionmailer
200 OK
GET http://api.rubygems.org/api/v1/dependencies?gems=actionmailer
302 Moved Temporarily
GET http://bundler.rubygems.org/api/v1/dependencies?gems=actionmailer
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=activerecord
302 Moved Temporarily
GET https://bundler.rubygems.org/api/v1/dependencies?gems=activerecord
200 OK
GET http://api.rubygems.org/api/v1/dependencies?gems=activerecord
302 Moved Temporarily
GET http://bundler.rubygems.org/api/v1/dependencies?gems=activerecord
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=actionpack
302 Moved Temporarily
GET https://bundler.rubygems.org/api/v1/dependencies?gems=actionpack
200 OK
GET http://api.rubygems.org/api/v1/dependencies?gems=actionpack
302 Moved Temporarily
GET http://bundler.rubygems.org/api/v1/dependencies?gems=actionpack
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=activesupport
302 Moved Temporarily
GET https://bundler.rubygems.org/api/v1/dependencies?gems=activesupport
200 OK
GET http://api.rubygems.org/api/v1/dependencies?gems=activesupport
302 Moved Temporarily
GET http://bundler.rubygems.org/api/v1/dependencies?gems=activesupport
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=activemodel
302 Moved Temporarily
GET https://bundler.rubygems.org/api/v1/dependencies?gems=activemodel
200 OK
GET http://api.rubygems.org/api/v1/dependencies?gems=activemodel
302 Moved Temporarily
GET http://bundler.rubygems.org/api/v1/dependencies?gems=activemodel
200 OK
GET https://api.rubygems.org/api/v1/dependencies?gems=sprockets-rails
302 Moved Temporarily
ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
no such name (https://api.rubygems.org/api/v1/dependencies?gems=sprockets-rails)
答案1
我上周按照这里的说明安装了轨道:
http://railsapps.github.io/installrubyonrails-ubuntu.html
各操作指南之间的显著差异如下:
--ruby
在命令中添加:
\curl -L https://get.rvm.io | bash -s stable --ruby
更新 RVM 的命令如下:
rvm get stable --autolibs=enable
要使用的 ruby 版本已明确设置:
rvm --default use ruby-2.1.0
js.Node 的安装
sudo apt-get install nodejs
安装 rails 之前也要明确设置版本:
rvm use [email protected] --create