0
我試圖使用API作爲我的rails應用程序的數據庫使用ActiveRestClient
,但是當我嘗試從API查詢時,我得到一個ArgumentError: no time information in "0"
。我不明白time.rb的調用來自何處。任何想法是什麼導致這個問題,我怎麼能解決這個問題?ArgumentError:沒有時間信息在「0」使用ActiveRestClient in rails 4.2.1
提前致謝!
這是我使用的代碼:
class Db < ActiveRestClient::Base
base_url "https://Placeholder/api/vtest/"
get :all, "/customer?apiKey=tester"
get :find, "/customer/:id?apiKey=tester"
before_request do |name, request|
request.headers["Accept"] = "application/json"
request.headers["User-Agent"] = "random"
end
end
這是錯誤消息我得到:
ArgumentError: no time information in "0"
from /home/wouter/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/time.rb:252:in `make_time'
from /home/wouter/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/time.rb:364:in `parse'
from /home/wouter/.rvm/gems/[email protected]/gems/active_rest_client-1.0.8/lib/active_rest_client/caching.rb:69:in `write_cached_response'
from /home/wouter/.rvm/gems/[email protected]/gems/active_rest_client-1.0.8/lib/active_rest_client/request.rb:162:in `block in call'
from /home/wouter/.rvm/gems/[email protected]/gems/activesupport-4.2.1/lib/active_support/notifications.rb:164:in `block in instrument'
from /home/wouter/.rvm/gems/[email protected]/gems/activesupport-4.2.1/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
from /home/wouter/.rvm/gems/[email protected]/gems/activesupport-4.2.1/lib/active_support/notifications.rb:164:in `instrument'
from /home/wouter/.rvm/gems/[email protected]/gems/active_rest_client-1.0.8/lib/active_rest_client/request.rb:116:in `call'
from /home/wouter/.rvm/gems/[email protected]/gems/active_rest_client-1.0.8/lib/active_rest_client/mapping.rb:46:in `_call'
from /home/wouter/.rvm/gems/[email protected]/gems/active_rest_client-1.0.8/lib/active_rest_client/mapping.rb:28:in `block in _map_call'
from (irb):1
from /home/wouter/.rvm/gems/[email protected]/gems/railties-4.2.1/lib/rails/commands/console.rb:110:in `start'
from /home/wouter/.rvm/gems/[email protected]/gems/railties-4.2.1/lib/rails/commands/console.rb:9:in `start'
from /home/wouter/.rvm/gems/[email protected]/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:68:in `console'
from /home/wouter/.rvm/gems/[email protected]/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/wouter/.rvm/gems/[email protected]/gems/railties-4.2.1/lib/rails/commands.rb:17:in `<top (required)>'
from /home/wouter/.rvm/gems/[email protected]/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
from /home/wouter/.rvm/gems/[email protected]/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `block in require'
from /home/wouter/.rvm/gems/[email protected]/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/wouter/.rvm/gems/[email protected]/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:274:in `require'
from /home/wouter/projects/NavAds/Test/bin/rails:8:in `<top (required)>'
from /home/wouter/.rvm/gems/[email protected]/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
from /home/wouter/.rvm/gems/[email protected]/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `block in load'
from /home/wouter/.rvm/gems/[email protected]/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /home/wouter/.rvm/gems/[email protected]/gems/activesupport-4.2.1/lib/active_support/dependencies.rb:268:in `load'
from /home/wouter/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /home/wouter/.rvm/rubies/ruby-2.2.2/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
它不能被歸類爲答案。 –
如何回答沒有文件? – Abel