ActionController::RoutingError when js => true - ruby-on-rails-3

None of my tests have an error, except the one I'm adding with js => true. Oddly enough the test would pass if not for a routing error.
My test:
context 'Javascript', :js => true do
visit careers_path
page.should have_content("Your Recommendations")
end
I can actual puts page.body and see that the content is there, but it still comes up with this routing error. I notice that while running the actual server and it comes up with a GET request for the assets folder. I don't understand why or what is doing this, but it seems to be the cause of failure.
The errors:
While running rails s
Started GET "/assets/" for 127.0.0.1 at 2013-08-12 19:11:02 -0400
Served asset / - 404 Not Found (5ms)
While running rspec
Failure/Error: Unable to find matching line from backtrace
ActionController::RoutingError:
No route matches [GET] "/assets"
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.14/lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.14/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.14/lib/rails/rack/logger.rb:32:in `call_app'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.14/lib/rails/rack/logger.rb:16:in `block in call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.14/lib/active_support/tagged_logging.rb:22:in `tagged'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.14/lib/rails/rack/logger.rb:16:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.14/lib/action_dispatch/middleware/request_id.rb:22:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/activesupport-3.2.14/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/actionpack-3.2.14/lib/action_dispatch/middleware/static.rb:63:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.14/lib/rails/engine.rb:484:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/railties-3.2.14/lib/rails/application.rb:231:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/builder.rb:134:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/urlmap.rb:64:in `block in call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `each'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/capybara-2.1.0/lib/capybara/server.rb:19:in `call'
# /Users/tom/.rvm/gems/ruby-1.9.3-p429/gems/rack-1.4.5/lib/rack/handler/webrick.rb:59:in `service'
# /Users/tom/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
# /Users/tom/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
# /Users/tom/.rvm/rubies/ruby-1.9.3-p429/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
On a side note, adding config.action_dispatch.show_exceptions = true to config/environments/test.rb allows the test to pass, it does not explain why it is happening, it merely suppresses the warning

Related

Routing error in Rails4 passenger and apache

I am trying to deploy my Rails4 app locally(I just want to it run on my Mac). I use Passenger and Apache for deployment. After some configuration, my home page works fine. But when I click any links on my homepage or go to any other path, I got this error:
The page you were looking for doesn't exist.
So I added this line to my httpd.conf file in apache
RailsEnv development
And now I got this error:
No route matches [GET] "/Users/joey/Sites/index.html"
No route matches [POST] "/Users/joey/Sites/index.html" (If I make a post request)
My project directory is "/Users/joey/Sites/depot" and this is my httpd.conf file:
<VirtualHost *:80>
ServerName depot.joeyhu.info
DocumentRoot /Users/joey/Sites/depot/public/
RailsEnv development
<Directory /Users/joey/Sites/depot/public>
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
LoadModule passenger_module /Users/joey/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/passenger-4.0.50/buildout/apache2/mod_passenger.so
<IfModule mod_passenger.c>
PassengerRoot /Users/joey/.rbenv/versions/2.1.0/lib/ruby/gems/2.1.0/gems/passenger-4.0.50
PassengerDefaultRuby /Users/joey/.rbenv/versions/2.1.0/bin/ruby
</IfModule>
This is my rails log(development.log and production.log basically show the same error):
I, [2014-09-12T10:31:17.300176 #41946] INFO -- : Started GET "/Users/joey/Sites/index.html" for 127.0.0.1 at 2014-09-12 10:31:17 -0700
F, [2014-09-12T10:31:17.300964 #41946] FATAL -- :
ActionController::RoutingError (No route matches [GET] "/Users/joey/Sites/index.html"):
actionpack (4.1.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.1.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.1.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.1.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.1.2) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.1.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.1.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.1.2) lib/active_support/cache/strategy/local_cache_middleware.rb:26:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.1.2) lib/rails/engine.rb:514:in `call'
railties (4.1.2) lib/rails/application.rb:144:in `call'
passenger (4.0.50) lib/phusion_passenger/rack/thread_handler_extension.rb:74:in `process_request'
passenger (4.0.50) lib/phusion_passenger/request_handler/thread_handler.rb:141:in `accept_and_process_next_request'
passenger (4.0.50) lib/phusion_passenger/request_handler/thread_handler.rb:109:in `main_loop'
passenger (4.0.50) lib/phusion_passenger/request_handler.rb:455:in `block (3 levels) in start_threads'
Except the root_url, it loooks like whatever path I go to, it will make a get or post request to the URL "/Users/joey/Sites/index.html" which doesn't make sense. Can someone help me? Thanks!
I am using Rails 4.1.2.

No Backtrace on request specs with Rspec

I have a request spec like this
require 'rails_helper'
describe 'People API' do
describe 'GET /api/v1/people/lookup.json?phone_number=PHONE_NUMBER', :wip do
it 'returns a 200 status code' do
auth_get '/api/v1/people/lookup.json', phone_number: '91900199'
expect(response.status).to eq(200)
end
end
end
and if the specs fail for some reason I just get a 500 status code in the response, and that's it, so I have to check the log/test.log file to get to know what went wrong, that is pretty annoying.
Why rspec is not showing the backtrace like in other types of specs?
Here is how I run my specs, notice that I include the -b option
$ rspec -b -t wip -f documentation
Run options: include {:wip=>true}
People API
GET /api/v1/people/lookup.json?phone_number=PHONE_NUMBER
returns a 200 status code
Failures:
1) People API GET /api/v1/people/lookup.json?phone_number=PHONE_NUMBER with an empty phone number returns a empty response
Failure/Error: expect(response.status).to eq(200)
expected: 200
got: 500
(compared using ==)
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-expectations-3.0.1/lib/rspec/expectations/fail_with.rb:30:in `fail_with'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-expectations-3.0.1/lib/rspec/expectations/handler.rb:35:in `handle_failure'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-expectations-3.0.1/lib/rspec/expectations/handler.rb:48:in `handle_matcher'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-expectations-3.0.1/lib/rspec/expectations/expectation_target.rb:54:in `to'
# ./spec/requests/api/v1/people_spec.rb:15:in `block (4 levels) in <top (required)>'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:148:in `instance_exec'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:148:in `block in run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:210:in `call'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:210:in `block (2 levels) in <class:Procsy>'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-rails-3.0.1/lib/rspec/rails/adapters.rb:68:in `block (2 levels) in <module:MinitestLifecycleAdapter>'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:294:in `instance_exec'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:294:in `instance_exec'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/hooks.rb:430:in `block (2 levels) in run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:210:in `call'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:210:in `block (2 levels) in <class:Procsy>'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/hooks.rb:432:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/hooks.rb:485:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:303:in `with_around_example_hooks'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example.rb:145:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:494:in `block in run_examples'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:490:in `map'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:490:in `run_examples'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:457:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `block in run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `map'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `block in run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `map'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/example_group.rb:458:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:112:in `block (2 levels) in run_specs'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:112:in `map'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:112:in `block in run_specs'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/reporter.rb:54:in `report'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:108:in `run_specs'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:86:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:70:in `run'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/lib/rspec/core/runner.rb:38:in `invoke'
# /Users/fespinoza/.rbenv/versions/2.1.1/lib/ruby/gems/2.1.0/gems/rspec-core-3.0.1/exe/rspec:4:in `<top (required)>'
# /Users/fespinoza/.rbenv/versions/2.1.1/bin/rspec:23:in `load'
# /Users/fespinoza/.rbenv/versions/2.1.1/bin/rspec:23:in `<main>'
Finished in 0.46863 seconds (files took 3.59 seconds to load)
1 examples, 1 failures
but it does not contain the real reason of the 500 error
Your request specs interact with your full stack, including middleware. When an error occurs inside one of your controller methods, it is caught higher up the stack so that a 500 error can be returned to the client. This is what you are seeing in the assertion failure.
You might be able to write your own middleware for testing purposes which prints errors to stderr if you really want this.

500 Error with the latest Gitlab (6.23)

Just backup and reinstall it.
Basic Information:
System information
System: Ubuntu 12.04
Current User: git
Using RVM: no
Ruby Version: 2.0.0p247
Gem Version: 2.0.3
Bundler Version:1.3.5
Rake Version: 10.1.0
GitLab information
Version: 6.2.3
Revision: b490fde
Directory: /home/git/gitlab
DB Adapter: mysql2
URL: https://git.XXXX.org
HTTP Clone URL: https://git.XXXX.org/some-project.git
SSH Clone URL: git#git.XXXX.org:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 1.7.6
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/local/bin/git
If I check status with this command:
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Everything is OK and green.
No error found in Nginx log.
Error log found in gitlab/log/production.log (this error was created every time I refresh the webpage):
Started GET "/" for 127.0.0.1 at 2013-11-12 22:23:24 -0800
Processing by DashboardController#show as HTML
Completed 401 Unauthorized in 5ms
Redis::ProtocolError ( Got 'H' as initial reply byte. If you're in a forking environment, such as Unicorn, you need to connect to Redis after forking. ):
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/connection/ruby.rb:257:in `format_reply'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/connection/ruby.rb:244:in `read'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:215:in `block in read'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:206:in `io'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:214:in `read'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:84:in `block in call'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:187:in `block (2 levels) in process'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:295:in `ensure_connected'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:177:in `block in process'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:256:in `logging'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:176:in `process'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis/client.rb:84:in `call'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis.rb:630:in `block in set'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis.rb:36:in `block in synchronize'
/usr/local/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis.rb:36:in `synchronize'
vendor/bundle/ruby/2.0.0/gems/redis-3.0.4/lib/redis.rb:629:in `set'
vendor/bundle/ruby/2.0.0/gems/redis-store-1.1.4/lib/redis/store/interface.rb:9:in `set'
vendor/bundle/ruby/2.0.0/gems/redis-store-1.1.4/lib/redis/store/ttl.rb:8:in `set'
vendor/bundle/ruby/2.0.0/gems/redis-store-1.1.4/lib/redis/store/marshalling.rb:5:in `block in set'
vendor/bundle/ruby/2.0.0/gems/redis-store-1.1.4/lib/redis/store/marshalling.rb:29:in `_marshal'
vendor/bundle/ruby/2.0.0/gems/redis-store-1.1.4/lib/redis/store/marshalling.rb:5:in `set'
vendor/bundle/ruby/2.0.0/gems/redis-rack-1.4.4/lib/rack/session/redis.rb:31:in `block in get_session'
vendor/bundle/ruby/2.0.0/gems/redis-rack-1.4.4/lib/rack/session/redis.rb:55:in `with_lock'
vendor/bundle/ruby/2.0.0/gems/redis-rack-1.4.4/lib/rack/session/redis.rb:28:in `get_session'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:251:in `load_session'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/session/abstract_store.rb:49:in `block in load_session'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/session/abstract_store.rb:57:in `stale_session_check!'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/session/abstract_store.rb:49:in `load_session'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:135:in `load!'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:131:in `load_for_write!'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:71:in `[]='
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/failure_app.rb:176:in `store_location!'
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/failure_app.rb:55:in `redirect'
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/failure_app.rb:37:in `respond'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:167:in `process_action'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/abstract_controller/base.rb:121:in `process'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_controller/metal.rb:203:in `dispatch'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_controller/metal.rb:246:in `block in action'
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/failure_app.rb:20:in `call'
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/failure_app.rb:20:in `call'
vendor/bundle/ruby/2.0.0/gems/devise-2.2.5/lib/devise/delegator.rb:5:in `call'
vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:130:in `call_failure_app'
vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:116:in `process_unauthenticated'
vendor/bundle/ruby/2.0.0/gems/warden-1.2.3/lib/warden/manager.rb:47:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/etag.rb:23:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/conditionalget.rb:25:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/head.rb:14:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/params_parser.rb:21:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:242:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:210:in `context'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/session/abstract/id.rb:205:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/cookies.rb:341:in `call'
vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/query_cache.rb:64:in `call'
vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:in `block in call'
vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `_run__1837039011266915719__call__1965958118966391004__callbacks'
vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:405:in `__run_callback'
vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/callbacks.rb:81:in `run_callbacks'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:27:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/rack/logger.rb:32:in `call_app'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `block in call'
vendor/bundle/ruby/2.0.0/gems/activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:in `tagged'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/rack/logger.rb:16:in `call'
vendor/bundle/ruby/2.0.0/gems/actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/methodoverride.rb:21:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/runtime.rb:17:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/lock.rb:15:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:136:in `forward'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:143:in `pass'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:172:in `rescue in lookup'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:168:in `lookup'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:66:in `call!'
vendor/bundle/ruby/2.0.0/gems/rack-cache-1.2/lib/rack/cache/context.rb:51:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/engine.rb:479:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/application.rb:223:in `call'
vendor/bundle/ruby/2.0.0/gems/railties-3.2.13/lib/rails/railtie/configurable.rb:30:in `method_missing'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/builder.rb:134:in `call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/urlmap.rb:64:in `block in call'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `each'
vendor/bundle/ruby/2.0.0/gems/rack-1.4.5/lib/rack/urlmap.rb:49:in `call'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:552:in `process_client'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:632:in `worker_loop'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/lib/unicorn/http_server.rb:142:in `start'
vendor/bundle/ruby/2.0.0/gems/unicorn-4.6.3/bin/unicorn_rails:209:in `<top (required)>'
vendor/bundle/ruby/2.0.0/bin/unicorn_rails:23:in `load'
vendor/bundle/ruby/2.0.0/bin/unicorn_rails:23:in `<main>'
Dump of /gitlab-shell/config.yml:
# GitLab user. git by default
user: git
# Url to gitlab instance. Used for api calls. Should end with a slash.
gitlab_url: "http://git.XXXX.org/"
http_settings:
# user: someone
# password: somepass
# ca_file: /etc/ssl/certs
# ca_path: /etc/ssl/localcerts
self_signed_cert: false
# Repositories path
# Give the canonicalized absolute pathname,
# REPOS_PATH MUST NOT CONTAIN ANY SYMLINK!!!
# Check twice that none of the components is a symlink, including "/home".
repos_path: "/home/git/repositories"
# File used as authorized_keys for gitlab user
auth_file: "/home/git/.ssh/authorized_keys"
# Redis settings used for pushing commit notices to gitlab
redis:
bin: /usr/bin/redis-cli
host: 127.0.0.1
port: 6379
# socket: /tmp/redis.socket # Only define this if you want to use sockets
namespace: resque:gitlab
# rest of this file remain unchanged.
Nginx Configuration File:
upstream gitlab {
server unix:/home/git/gitlab/tmp/sockets/gitlab.socket;
}
server {
listen 173.230.1.2:80;
server_name git.XXXX.org;
server_tokens off;
root /nowhere; # this doesn't have to be a valid path since we are redirecting, you don't have to change it.
rewrite ^ https://$server_name$request_uri permanent;
}
server {
listen 173.230.1.2:443 ssl; # e.g., listen 192.168.1.1:80; In most cases *:80 is a good idea
server_name git.XXXX.org; # e.g., server_name source.example.com;
server_tokens off; # don't show the version number, a security best practice
root /home/git/gitlab/public;
ssl on;
ssl_certificate /etc/ssl/localcerts/git.XXXX.org.crt;
ssl_certificate_key /etc/ssl/localcerts/git.XXXX.org.key;
ssl_ciphers RC4:HIGH:!aNULL:!MD5:!kEDH;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
# individual nginx logs for this gitlab vhost
access_log /var/log/nginx/gitlab_access.log;
error_log /var/log/nginx/gitlab_error.log;
#rest of this file remain unchanges
Part of Unicorn config file:
working_directory "/home/git/gitlab" # available in 0.94.0+
# listen on both a Unix domain socket and a TCP port,
# we use a shorter backlog for quicker failover when busy
listen "/home/git/gitlab/tmp/sockets/gitlab.socket", :backlog => 64
listen "127.0.0.1:6379", :tcp_nopush => true
It seems unicorn throws a 401 error according to the logs.
Anyone familiar with Gitlab please help me.
By the way, this is my 4th time reinstalling the Gitlab.

Rails isn't loading my JS properly - ERROR bad Request-Line `'

I have a Rails 3.2.3 app isn't consistently loading JS files. I just started working on the JS, so I'm not sure if this just started, or if it's been this way since I started it a few days ago.
The two other guys working on the project are not having any problems at all. But sometimes it loads all of my files, sometimes it skips some, there doesn't seem to be any pattern.
Sometimes it loads app.js, sometimes it doesn't. Same thing with the other js files.
I'm seeing the following show up multiple times in my rails log:
ERROR bad Request-Line `'.
I'm at a loss here...
application.js:
//= require jquery
//= require jquery_ujs
//= require util
//= require app
//= require_tree .
Here is what the log file is showing:
Started GET "/assets/user_manager.js?body=1" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /user_manager.js - 200 OK (0ms)
Started GET "/assets/util.js?body=1" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /util.js - 200 OK (0ms)
[2012-11-07 18:02:13] ERROR bad Request-Line `'.
[2012-11-07 18:02:13] ERROR bad Request-Line `'.
[2012-11-07 18:02:13] ERROR bad Request-Line `'.
Started GET "/assets/header/topnav/separator.png" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /header/topnav/separator.png - 200 OK (0ms)
Started GET "/assets/header/pagetitle-bg.png" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /header/pagetitle-bg.png - 200 OK (0ms)
[2012-11-07 18:02:13] ERROR bad Request-Line `'.
Started GET "/assets/header_bg.png" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /header_bg.png - 404 Not Found (3ms)
ActionController::RoutingError (No route matches [GET] "/assets/header_bg.png"):
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.3) lib/rails/engine.rb:479:in `call'
railties (3.2.3) lib/rails/application.rb:220:in `call'
rack (1.4.1) lib/rack/c[2012-11-07 18:02:13] ERROR bad Request-Line `'.
ontent_length.rb:14:in `call'
railties (3.2.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
/Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
Rendered /Users/rob/.rvm/gems/ruby-1.9.3-p125#admin/gems/actionpack-3.2. 3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.1ms)
Started GET "/assets/background/header_blueprint.png" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /background/header_blueprint.png - 200 OK (0ms)
Started GET "/assets/images/ui-icons_454545_256x240.png" for 127.0.0.1 at 2012-11-07 18:02:13 -0500
Served asset /images/ui-icons_454545_256x240.png - 404 Not Found (3ms)
ActionController::RoutingError (No route matches [GET] "/assets/images/ui-icons_454545_256x240.png"):
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.3) lib/rails/engine.rb:479:in `call'
railties (3.2.3) lib/rails/application.rb:220:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
/Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/Users/rob/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
Rendered /Users/rob/.rvm/gems/ruby-1.9.3-p125#admin/gems/actionpack-3.2. 3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.8ms)
[2012-11-07 18:02:13] ERROR bad Request-Line `'.
[2012-11-07 18:02:13] ERROR bad Request-Line `'.
[2012-11-07 18:02:13] ERROR bad Request-Line `'.
I had the same problem with JS and CSS files randomly failing to load in Google Chrome, this error showing in the logs:
ERROR bad Request-Line `'.
The problem must have been cookie related, though deleting the cookie did not work for me. I solved the problem by renaming they key in config/initializers/session_store.rb and then renaming it back once the problem was gone. Strange.

Mailgun HTTP POST to with Rails 3 - (undefined method `rewind' for #<String:0xb701ace0>)

Does anyone have any theories about this?
I have a feeling this is a Rails 3.x bug.
I'm using a service called mailgun that routes incoming e-mails to url's for further processing. Rails 3 chokes on these requests. Rails 2 does not.
I'm at a loss. I'm not sure exactly where the issue is.
Started POST "/posts/upload" for 174.37.214.195 at Fri Mar 11 20:22:41 -0500 2011
SQL (0.1ms) SET search_path TO public
SQL (0.2ms) SHOW client_min_messages
SQL (0.1ms) SET client_min_messages TO 'panic'
SQL (0.1ms) SET standard_conforming_strings = on
SQL (0.1ms) SET client_min_messages TO 'notice'
SQL (0.4ms) SET time zone 'UTC'
SQL (0.1ms) SHOW TIME ZONE
NoMethodError (undefined method `rewind' for #<String:0xb6d1c624>):
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (1.0ms)
Error during failsafe response: ActionView::Template::Error
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.4/lib/active_support/whiny_nil.rb:48:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_dispatch/http/parameters.rb:10:in `parameters'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb:3:in `__usr_lib_ruby_gems_____gems_actionpack_______lib_action_dispatch_middleware_templates_rescues_diagnostics_erb___359554262__609638518_0'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_view/template.rb:135:in `send'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_view/template.rb:135:in `render'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.4/lib/active_support/notifications.rb:54:in `instrument'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_view/template.rb:127:in `render'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_view/render/rendering.rb:59:in `_render_template'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.4/lib/active_support/notifications.rb:52:in `instrument'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.4/lib/active_support/notifications/instrumenter.rb:21:in `instrument'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.4/lib/active_support/notifications.rb:52:in `instrument'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_view/render/rendering.rb:56:in `_render_template'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_view/render/rendering.rb:26:in `render_without_haml'
/usr/lib/ruby/gems/1.8/gems/haml-3.0.25/lib/haml/helpers/action_view_mods.rb:13:in `render'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_dispatch/middleware/show_exceptions.rb:88:in `rescue_action_locally'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_dispatch/middleware/show_exceptions.rb:68:in `render_exception'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_dispatch/middleware/show_exceptions.rb:59:in `call'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/rack/logger.rb:13:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/runtime.rb:17:in `call'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.4/lib/active_support/cache/strategy/local_cache.rb:72:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/lock.rb:11:in `synchronize'
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/lock.rb:11:in `call'
/usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_dispatch/middleware/static.rb:30:in `call'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:168:in `call'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:77:in `send'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/application.rb:77:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/rack/log_tailer.rb:14:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/content_length.rb:13:in `call'
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb:52:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/handler/webrick.rb:13:in `run'
/usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/commands/server.rb:65:in `start'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/commands.rb:30
/usr/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/commands.rb:27:in `tap'
/usr/lib/ruby/gems/1.8/gems/railties-3.0.4/lib/rails/commands.rb:27
script/rails:6:in `require'
script/rails:6
Started POST "/posts" for 174.37.214.196 at Fri Mar 11 20:24:24 -0500 2011
NoMethodError (undefined method `rewind' for #<String:0xb701ace0>):
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.4/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (1.1ms)
Two ideas: either your routing is configured differently, or there's "forgery protection" going on. Not exactly a rails expert here... :)