mongoid cannot connect to remote server, no auth - ruby-on-rails

I have a mongod running at my network's internal subnet of 10.1.150.24 and my mogoid.yml has these lines:
hosts:
- 10.1.150.24:27017
MongoDB is running without authentication on the remote server.
On the remote server a rails app with - localhost:27017 connects without issues. The mongod.conf has
net:
bindIp: 0.0.0.0
set and should accept connections on all interfaces.
I can see the connection error when I am in rails c on my local and try to create an object or even retrieve one.
Foo.create(...) failes like this:
TypeError: no implicit conversion of nil into String
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/protocol/commands/authenticate.rb:35:in `+'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/protocol/commands/authenticate.rb:35:in `digest'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/protocol/commands/authenticate.rb:47:in `build_auth_command'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/protocol/commands/authenticate.rb:25:in `initialize'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/authenticatable.rb:71:in `new'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/authenticatable.rb:71:in `login'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/authenticatable.rb:28:in `block in apply_credentials'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/authenticatable.rb:26:in `each'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/authenticatable.rb:26:in `apply_credentials'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/node.rb:180:in `block in ensure_connected'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/node.rb:115:in `block in connection'
from /var/lib/gems/2.2.0/gems/connection_pool-2.1.1/lib/connection_pool.rb:62:in `with'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/node.rb:114:in `connection'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/node.rb:178:in `ensure_connected'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/node.rb:589:in `block in flush'
from /var/lib/gems/2.2.0/gems/moped-2.0.3/lib/moped/node.rb:617:in `block in logging'
... 33 levels...
from /var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/console.rb:9:in `start'
from /var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:68:in `console'
from /var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /var/lib/gems/2.2.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `block in require'
from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:274:in `require'
from /home/mwerner/workspace/pricing/bin/rails:8:in `<top (required)>'
from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `block in load'
from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:240:in `load_dependency'
from /var/lib/gems/2.2.0/gems/activesupport-4.2.0/lib/active_support/dependencies.rb:268:in `load'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
Given the number of authentication errors with moped I am confused since there is no authentication on the mongo instance.
EDIT: I also tried ssh tunneling the 27017 port to my local and setting localhost in monogoid.yml No luck

running sudo gem pristine --all and killing the spring process fixed the issue. I can now connect to the remote server.

Related

Selenium WebDriver Error: No Such Frame Error

I'm trying to run this: https://github.com/jmopr/job-hunter
I executed it via the command: rails server. collected a few job postings to apply to, then when i clicked on "Apply to jobs" a window popped up but none of the information that was to be submitted to indeed.com got pasted in the forms. The window then closed and it went on to the next job profile. It doesn't seem like it is able to select the proper frame, and i'm not sure exactly what causes this.
main error:
[remote server] file:///tmp/webdriver-profile20170831-19043-haskqi/extensions/fxdriver#googlecode.com/components/driver-component.js:10840:in `FirefoxDriver.prototype.switchToFrame': Unable to locate frame: 1 (Selenium::WebDriver::Error::NoSuchFrameError)
Since i suspect the main culprit here are compatibility issues, here are a list of software and specific gems that may be out of date or updated in a way that makes it incompatible:
Firefox: 45. Ubuntu 16.04. Geckodriver 1.18.0(irrelevant???)
Selenium: 0.2.11. Selenium webdriver: 2.53.0.
I tried playing around with different versions of firefox, the webdriver to see if i had any compatibility issues, no success. Here is the rest of the error:
Started GET "/users/apply" for 127.0.0.1 at 2017-08-31 14:08:21 -0700
Processing by JobsController#apply as HTML
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT 1 [["id", 1]]
Job Load (0.3ms) SELECT "jobs".* FROM "jobs" WHERE (score > 40)
Running via Spring preloader in process 19571
applier.rb:121: warning: key "How did you hear about this job?" is duplicated and overwritten on line 127
^C[2017-08-31 14:08:31] INFO going to shutdown ...
/var/lib/gems/2.3.0/gems/childprocess-0.5.9/lib/childprocess/abstract_process.rb:148:in `sleep': Interrupt
from /var/lib/gems/2.3.0/gems/childprocess-0.5.9/lib/childprocess/abstract_process.rb:148:in `poll_for_exit'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/binary.rb:59:in `quit'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/launcher.rb:62:in `quit'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/firefox/bridge.rb:77:in `quit'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/common/driver.rb:175:in `quit'
from /var/lib/gems/2.3.0/gems/capybara-2.7.0/lib/capybara/selenium/driver.rb:248:in `quit'
from /var/lib/gems/2.3.0/gems/capybara-2.7.0/lib/capybara/selenium/driver.rb:20:in `block in browser'
from /var/lib/gems/2.3.0/gems/spring-1.7.1/lib/spring/application.rb:161:in `fork'
from /var/lib/gems/2.3.0/gems/spring-1.7.1/lib/spring/application.rb:161:in `serve'
from /var/lib/gems/2.3.0/gems/spring-1.7.1/lib/spring/application.rb:131:in `block in run'
from /var/lib/gems/2.3.0/gems/spring-1.7.1/lib/spring/application.rb:125:in `loop'
from /var/lib/gems/2.3.0/gems/spring-1.7.1/lib/spring/application.rb:125:in `run'
from /var/lib/gems/2.3.0/gems/spring-1.7.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
[remote server] file:///tmp/webdriver-profile20170831-19571-ugrrq/extensions/fxdriver#googlecode.com/components/driver-component.js:10840:in `FirefoxDriver.prototype.switchToFrame': Unable to locate frame: 1 (Selenium::WebDriver::Error::NoSuchFrameError)
from [remote server] file:///tmp/webdriver-profile20170831-19571-ugrrq/extensions/fxdriver#googlecode.com/components/command-processor.js:12661:in `DelayedCommand.prototype.executeInternal_/h'
from [remote server] file:///tmp/webdriver-profile20170831-19571-ugrrq/extensions/fxdriver#googlecode.com/components/command-processor.js:12666:in `DelayedCommand.prototype.executeInternal_'
from [remote server] file:///tmp/webdriver-profile20170831-19571-ugrrq/extensions/fxdriver#googlecode.com/components/command-processor.js:12608:in `DelayedCommand.prototype.execute/<'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/remote/response.rb:70:in `assert_ok'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/remote/response.rb:34:in `initialize'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/remote/http/common.rb:78:in `new'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/remote/http/common.rb:78:in `create_response'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/remote/http/default.rb:90:in `request'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/remote/http/common.rb:59:in `call'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/remote/bridge.rb:649:in `raw_execute'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/remote/bridge.rb:627:in `execute'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/remote/bridge.rb:206:in `switchToFrame'
from /var/lib/gems/2.3.0/gems/selenium-webdriver-2.53.0/lib/selenium/webdriver/common/target_locator.rb:37:in `frame'
from /var/lib/gems/2.3.0/gems/capybara-2.7.0/lib/capybara/selenium/driver.rb:151:in `within_frame'
from applier.rb:29:in `scrape'
from applier.rb:169:in `<top (required)>'
from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/runner.rb:60:in `load'
from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/runner.rb:60:in `<top (required)>'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block in require'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:123:in `require_command!'
from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:90:in `runner'
from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /var/lib/gems/2.3.0/gems/railties-4.2.5.1/lib/rails/commands.rb:17:in `<top (required)>'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `block in require'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:274:in `require'
from /home/mo/Desktop/job-hunter-master/bin/rails:9:in `<top (required)>'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `block in load'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:240:in `load_dependency'
from /var/lib/gems/2.3.0/gems/activesupport-4.2.5.1/lib/active_support/dependencies.rb:268:in `load'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
The sad part is that I had this work before. It drives me crazy not to be able to replicate it. Could missing packages be causing this? Do we need to install the jar files (but i'm not using windows!!) as prompted when you first install the selenium gems?
Code (applier.rb):
def scrape
unless #job.applied
visit #job.url
unless page.has_css?('p.expired')
page.find('a.indeed-apply-button', match: :first).click
page.driver.within_frame(1) do
page.driver.within_frame(0) do
complete_step_one
complete_additional_steps
end
end
end
Job.delete(#job.id)
page.close
end

Can't start Rails server! "getaddrinfo: Name or service not known (SocketError)"

When I try to run my rails app using
RAILS_ENV=production rails s -binding=128.199.95.219
I get this error
/usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/socket.rb:232:in `getaddrinfo': getaddrinfo: Name or service not known (SocketError)
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/socket.rb:232:in `foreach'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/socket.rb:459:in `tcp_server_sockets'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/utils.rb:70:in `create_listeners'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:133:in `listen'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/server.rb:114:in `initialize'
from /usr/local/rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/webrick/httpserver.rb:45:in `initialize'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/handler/webrick.rb:31:in `new'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/handler/webrick.rb:31:in `run'
from /usr/local/rvm/gems/ruby-2.2.1/gems/rack-1.6.4/lib/rack/server.rb:286:in `start'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/server.rb:80:in `start'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:75:in `server'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /usr/local/rvm/gems/ruby-2.2.1/gems/railties-4.2.4/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
I've googled many places but still find no definite answer which could solve this problem.
My app is running in Ubuntu (14.0.4) with Nginx and Unicorn at DigitalOcean
Any idea anyone?
Use a double dash for the binding parameter, i.e.:
RAILS_ENV=production rails s --binding=128.199.95.219
See rails s --help for more info.

Cannot start rails server, I get an error

I'm new to Ruby on Rails. So, I'd got this error before, and I reinstalled rails and ruby and installed them again, but I still get it.
The error is:
/home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:80:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'uglifier'. (Bundler::GemRequireError)
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `each'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:72:in `block in require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `each'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler/runtime.rb:61:in `require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/bundler-1.11.2/lib/bundler.rb:99:in `require'
from /home/X/Documents/Appw/config/application.rb:7:in `<top (required)>'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `require'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:78:in `block in server'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/X/.rvm/gems/ruby-2.2.1/gems/railties-4.2.5/lib/rails/commands.rb:17:in `<top (required)>'
from /home/X/Documents/Appw/bin/rails:9:in `require'
from /home/X/Documents/Appw/bin/rails:9:in `<top (required)>'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client/rails.rb:28:in `load'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client/rails.rb:28:in `call'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client/command.rb:7:in `call'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/client.rb:28:in `run'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/bin/spring:51:in `<top (required)>'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/binstub.rb:11:in `load'
from /home/X/.rvm/gems/ruby-2.2.1/gems/spring-1.6.1/lib/spring/binstub.rb:11:in `<top (required)>'
from /home/X/Documents/Appw/bin/spring:13:in `require'
from /home/X/Documents/Appw/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'
I tried updating the uglifier gem, but nothing happened.
It looks like you have't installed nodejs
sudo apt-get install nodejs
Should work !!!
The problem was that I didn't have nodejs installed. After I've installed it, everything worked smoothly.
What is you gemfile/gem list?
Actually having meteor installed doesn't count as having nodejs installed. nodejs is required for uglifier package, so simple: yum install nodejs resolves the issue.

Unable to start rails server with -d switch

I am trying to start rails server as a daemon using the -d switch. I have installed thin server and working on Ubuntu. If it is started as a normal process, it works, but when using the -d switch, it complains of a server pid file /tmp/pids/server.pid
Even if I delete the file and try to start the server with -d switch, it won't start. Please help.
The error says:
/usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:33:in `block in setup': You have already activated daemons 1.1.9, but your Gemfile requires daemons 1.1.8. Using bundle exec may solve this. (Gem::LoadError)
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:19:in `setup'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler.rb:120:in `setup'
from /usr/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:35:in `require'
from /home/ubuntu/deploys/releases/20131001113746/config/boot.rb:6:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/ubuntu/deploys/releases/20131001113746/config/application.rb:1:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/ubuntu/deploys/releases/20131001113746/config/environment.rb:2:in `<top (required)>'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /home/ubuntu/deploys/releases/20131001113746/config.ru:3:in `block in <main>'
from /usr/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `instance_eval'
from /usr/lib/ruby/gems/1.9.1/gems/rack-1.4.5/lib/rack/builder.rb:51:in `initialize'
from /home/ubuntu/deploys/releases/20131001113746/config.ru:1:in `new'
from /home/ubuntu/deploys/releases/20131001113746/config.ru:1:in `<main>'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `eval'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:33:in `load'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/rack/adapter/loader.rb:42:in `for'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:169:in `load_adapter'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/controllers/controller.rb:73:in `start'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:187:in `run_command'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/lib/thin/runner.rb:152:in `run!'
from /usr/lib/ruby/gems/1.9.1/gems/thin-1.5.1/bin/thin:6:in `<top (required)>'
from /usr/bin/thin:23:in `load'
from /usr/bin/thin:23:in `<main>'
run the server using 'bundle exec' in the start like:
bundle exec rails s -d
Alternatively, your exception trace is stating a mismatch for the activated daemons gem. To fix this, set the version of daemons gem to be greater than (instead of equal to) 1.1.8 and try.

Error while starting WEBrick server using rails

I have an existing application with database ready I have made all the changes in database.yml and did bundle install when I am trying to do rails s to start the WEBrick server I am getting the following error
/usr/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir': File exists - /home/username/appname/app/releases/20120831125545/tmp (Errno::EEXIST)
from /usr/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir'
from /usr/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p'
from /usr/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each'
from /usr/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p'
from /usr/lib/ruby/1.9.1/fileutils.rb:205:in `each'
from /usr/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands/server.rb:62:in `block in start'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands/server.rb:61:in `each'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands/server.rb:61:in `start'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands.rb:30:in `block in <top (required)>'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands.rb:27:in `tap'
from /home/username/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.0.10/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Am I missing some step , Do I have to re run the migration (I have the database ready with me with data in it)
any help?
Apparently the tmp directory Rails uses for session store is already present. Try deleting the /tmp folder in your release directory.

Resources