我发现Rails rake任务出错,抱怨URI方案redis://
无效。我已经检查过,这是not a valid registered URI scheme with IANA。该错误导致@
符号无效registry part
。
+ bundle exec rake db:reset jasmine:ci:headless
rake aborted!
URI::InvalidURIError: the scheme redis does not accept registry part: :@: (or bad hostname?)
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/redis-store-1.1.3/lib/redis/factory.rb:23:in `resolve'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/redis-store-1.1.3/lib/redis/factory.rb:7:in `block in create'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/redis-store-1.1.3/lib/redis/factory.rb:6:in `each'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/redis-store-1.1.3/lib/redis/factory.rb:6:in `inject'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/redis-store-1.1.3/lib/redis/factory.rb:6:in `create'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/redis-activesupport-3.2.3/lib/active_support/cache/redis_store.rb:27:in `initialize'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/cache.rb:69:in `new'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/cache.rb:69:in `lookup_store'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/application/bootstrap.rb:54:in `block (2 levels) in <module:Bootstrap>'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/core_ext/kernel/reporting.rb:13:in `block in silence_warnings'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/core_ext/kernel/reporting.rb:24:in `with_warnings'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/core_ext/kernel/reporting.rb:13:in `silence_warnings'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/application/bootstrap.rb:54:in `block in <module:Bootstrap>'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `instance_exec'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/initializable.rb:30:in `run'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/initializable.rb:55:in `block in run_initializers'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `each'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/initializable.rb:54:in `run_initializers'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/application.rb:136:in `initialize!'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/railtie/configurable.rb:30:in `method_missing'
/home/jenkins/workspace/verify_refspec_jasmine/config/environment.rb:5:in `<top (required)>'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `block in require'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:236:in `load_dependency'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/activesupport-3.2.17/lib/active_support/dependencies.rb:251:in `require'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/application.rb:103:in `require_environment!'
/home/jenkins/workspace/verify_refspec_jasmine/vendor/bundle/ruby/1.9.1/gems/railties-3.2.17/lib/rails/application.rb:305:in `block (2 levels) in initialize_tasks'
Tasks: TOP => db:reset => environment
(See full trace by running task with --trace)
Shutdown completed cleanly
Build step 'Execute shell' marked build as failure
Finished: FAILURE
应用程序似乎已定义了以下列格式连接到Redis服务器的URI:
$ cd /path/to/mystery/app
$ ack --ignore-dir=vendor 'redis://'
config/application.rb
45: config.cache_store = :redis_store, "redis://:#{configatron.redis.password}@#{configatron.redis.host}:#{configatron.redis.port}/0/cache"
config/initializers/sidekiq.rb
2:url = "redis://"
config/initializers/session_store.rb
11: opts[:redis_server] = "redis://redistogo:#{REDIS_SERVER.client.password}@#{REDIS_SERVER.client.host}:#{REDIS_SERVER.client.port}/#{db}"
13: opts[:redis_server] = "redis://#{REDIS_SERVER.client.host}:#{REDIS_SERVER.client.port}/#{db}"
我很确定这些rake任务之前有效,所以我所知道的不应该导致这个错误发生了变化。
URI类如何验证方案URI?