Topic: How to deploy Sunspot Solr with Capistrano

I am having all kinds of issues trying to deploy sunspot to my local server. Currently going to [Server IP]:8983/solr/ gives me:

HTTP ERROR 500

Problem accessing /solr/. Reason:

    Could not initialize class org.apache.jasper.compiler.ErrorDispatcher

When I try to run 'cap deploy' I get:  'rake aborted! RSolr::Error::Http - 404 Not Found'

My deploy.rb:

namespace :deploy do
  task :start do ; end
  task :stop do ; end
  task :restart, :roles => :app, :except => { :no_release => true } do
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
  end

  desc "Migrate Database"
  task :migrate_db do
    run "cd #{current_path} && rake db:migrate RAILS_ENV=production"
    run "touch #{current_path}/tmp/restart.txt"
  end

  desc "Create Solr Directory"
  task :setup_solr_data_dir do
    run "mkdir -p #{shared_path}/solr/data"
  end
end

namespace :solr do
  desc "start solr"
  task :start, :roles => :app, :except => { :no_release => true } do
    run "cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec sunspot-solr start --port=8983 --data-directory=#{shared_path}/solr/data --pid-dir=#{shared_path}/pids > /dev/null 2>&1 || true"
  end
  desc "stop solr"
  task :stop, :roles => :app, :except => { :no_release => true } do
    run ("cd #{current_path} && RAILS_ENV=#{rails_env} bundle exec sunspot-solr stop --port=8983 --data-directory=#{shared_path}/solr/data --pid-dir=#{shared_path}/pids > /dev/null 2>&1 || true")
  end
  desc "reindex the whole database"
  task :reindex, :roles => :app do
    stop
    run "rm -rf #{shared_path}/solr/data"
    start
    run "cd #{current_path} && yes | RAILS_ENV=#{rails_env} bundle exec rake sunspot:solr:reindex"
  end

  desc "Symlink in-progress deployment to a shared Solr index"
  task :symlink, :except => { :no_release => true } do
    run "ln -s #{shared_path}/solr/data/ #{release_path}/solr/data"
    run "ln -s #{shared_path}/solr/pids/ #{release_path}/solr/pids"
  end
end

after 'deploy:update', 'deploy:setup_solr_data_dir'
after "deploy", "deploy:cleanup",  "deploy:migrate_db", "solr:symlink", 'solr:start', 'solr:reindex'

sunspot.yml

production:
  solr:
    hostname: localhost
    port: 8983
    log_level: WARNING
    auto_commit_after_request: true


development:
  solr:
    hostname: localhost
    port: 8983
    log_level: INFO

test:
  solr:
    hostname: localhost
    port: 8981
    log_level: WARNING

I have been wrestling with this for a few days. Please help! smile