折腾了好久,还是没能解决这个问题,服务器上运行的是 staging 环境, 本地通过 rails s -e production/staging/development 都是可以正确返回 json 数据: 错误如下:
Template is missing
Missing template instigates/index, application/index with {:locale=>[:en], :formats=>[:json], :handlers=>[:erb, :builder, :arb, :jbuilder, :rabl]}. Searched in: * "/home/yzhang/instigatestaging/instigateweb/app/views" * "/home/yzhang/.rvm/gems/ruby-2.1.5/gems/activeadmin-0.6.3/app/views" * "/home/yzhang/.rvm/gems/ruby-2.1.5/gems/kaminari-0.16.1/app/views" * "/home/yzhang/.rvm/gems/ruby-2.1.5/gems/devise-3.4.1/app/views"
Gemfile
source 'http://rubygems.org'
gem 'rails', '3.2.13'
gem 'rake','10.0.0'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
group :development, :test do
gem "factory_girl_rails", "~> 4.0"
#gem "sqlite3"
gem "shotgun"
end
group :test do
gem 'mocha', :require => false
gem 'rack-test'
gem 'vcr'
gem 'webmock'
end
gem 'jquery-rails'
gem 'mysql2'
# group :production do
# gem 'mysql2'
# end
# Use unicorn as the app server
gem 'unicorn'
# Deploy with Capistrano
gem 'capistrano', '2.15.4'
gem 'rails-i18n'
gem 'simple_form'
gem 'country-select'
# gem "urbanairship"
# gem 'auto_migrations' #,:git => "https://github.com/subicura/auto_migrations.git"
# =======
gem "urbanairship", "~> 2.3.3"
gem 'auto_migrations' ,:git => "https://github.com/subicura/auto_migrations.git"
gem "formtastic" # ,:git => "https://github.com/justinfrench/formtastic.git"
gem 'activeadmin', "~>0.6.2"
gem "meta_search", '>= 1.1.0.pre'
gem 'devise'
gem "paperclip", "~> 3.5.3"
gem 'koala'
gem "rest-client"
gem 'delayed_job_active_record'
gem 'daemons'
gem 'rocket_pants', '~> 1.0'
gem "chronic"
#gem "active_model_serializers"
gem "multi_json"
gem 'rvm-capistrano'
gem 'rabl'
gem 'jbuilder', '2.2.6'