Rails 4.0: ActionController::RoutingError - ruby-on-rails

When I'm starting serven in production mode, i got this page:
"The page you were looking for doesn't exist. You may have mistyped the address or the page may have moved."
App works normally in development mode.
Here is my logs:
I, [2013-04-22T11:27:17.618777 #15685] INFO -- : Started GET "/" for 127.0.0.1 at 2013-04-22 11:27:17 +0400
F, [2013-04-22T11:27:17.620365 #15685] FATAL -- :
ActionController::RoutingError (No route matches [GET] "/"):
actionpack (4.0.0.beta1) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.0.0.beta1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0.beta1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0.beta1) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0.beta1) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0.beta1) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0.beta1) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0.beta1) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0.beta1) 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.0.0.beta1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
actionpack (4.0.0.beta1) lib/action_dispatch/middleware/static.rb:64:in `call'
railties (4.0.0.beta1) lib/rails/engine.rb:510:in `call'
railties (4.0.0.beta1) lib/rails/application.rb:96:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
/home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
/home/u164/.rvm/rubies/ruby-1.9.3-p392/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
My Gemfile:
ruby "1.9.3"
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0.beta1'
gem 'execjs'
gem 'therubyracer'
#gem 'sqlite3'
gem 'pg'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 4.0.0.beta1'
gem 'coffee-rails', '~> 4.0.0.beta1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.0.1'

In Rails 4.0.0 when deploying to production, you will need to generate/create an index page which should be located in public/index.html.
I have successfully deployed on Amazon EC2 (AWS) using this fix.
For example:
$ rails generate controller welcome index

Related

Connection Not Enstablished - Ruby on Rails

I'm totally new to Ruby on Rails and I'm giving it a shot.
I'm saying in advance that I didn't find an answer to fit my problem nor here on StackOverflow nor on the internet (I tried lots of different things picked from SO and other web sites).
I'm following Rails for Zombies 2 on CodeSchool and I need to set up the enviroment in order to make things happen.
In order to make that, I'm following the setup phase from Michael Hartl's
Ruby on Rails Tutorial.
I followed every step but, when I would love to see: "hello, world!" in my browser I get:
ActiveRecord::ConnectionNotEstablished
No connection pool for ActiveRecord::Base
Full trace:
activerecord (4.2.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:566:in `retrieve_connection'
activerecord (4.2.2) lib/active_record/connection_handling.rb:113:in `retrieve_connection'
activerecord (4.2.2) lib/active_record/connection_handling.rb:87:in `connection'
activerecord (4.2.2) lib/active_record/query_cache.rb:51:in `restore_query_cache_settings'
activerecord (4.2.2) lib/active_record/query_cache.rb:43:in `rescue in call'
activerecord (4.2.2) lib/active_record/query_cache.rb:31:in `call'
activerecord (4.2.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.2) lib/active_support/callbacks.rb:88:in `call'
activesupport (4.2.2) lib/active_support/callbacks.rb:88:in `_run_callbacks'
activesupport (4.2.2) lib/active_support/callbacks.rb:776:in `_run_call_callbacks'
activesupport (4.2.2) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
web-console (2.0.0.beta3) lib/action_dispatch/debug_exceptions.rb:18:in `middleware_call'
web-console (2.0.0.beta3) lib/action_dispatch/debug_exceptions.rb:13:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.2) lib/action_dispatch/middleware/static.rb:113:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.2) lib/rails/engine.rb:518:in `call'
railties (4.2.2) lib/rails/application.rb:164:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
Before getting this, I installed Rails, I entered my hello_app folder and used: Bundle Install and then I just used: Rails Server. I also deleted index.html as said in the guide.
My Gemfile:
source 'https://rubygems.org'
gem 'rails', '4.2.2'
gem 'sass-rails', '5.0.2'
gem 'uglifier', '2.5.3'
gem 'coffee-rails', '4.1.0'
gem 'jquery-rails', '>= 3.0.0'
gem 'turbolinks', '2.3.0'
gem 'jbuilder', '2.2.3'
gem 'sdoc', '0.4.0', group: :doc
group :development, :test do
gem 'sqlite3'
gem 'pry-byebug', platform: [:ruby_20]
gem 'web-console', '2.0.0.beta3'
gem 'spring', '1.1.3'
end
My Application Controller:
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
def hello
render text: "hello, world!"
end
end
My Routes:
HelloApp::Application.routes.draw do
root 'application#hello
end
My Database:
development:
adapter: sqlite3
database: db/development.sqlite3
pool: 5
timeout: 5000
test:
adapter: sqlite3
database: db/test.sqlite3
pool: 5
timeout: 5000
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
I'm sorry if my problem is trivial and I'm also sorry for my awful english.
Thank you in advance!
BTW, have you run the bundle exec rake db:setup before starting the server? It looks like if your database just doesn't exist yet (you can check whether the db/development.sqlite3 file exists).
I solved it by myself. It was a problem cause by a broken Gemfile.
The right configuration that allowed me to let it work is:
Gemfile:
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.2'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'debugger' anywhere in the code to stop execution and get a debugger console
gem 'debugger'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end

Can't Run server with Rails 4.2.4.rc1

This is sort of related to my other question listed here, but those solutions didn't work for me so I created a new rails app, but I got the same error, which I've listed below.
Started GET "/" for ::1 at 2015-08-29 16:26:01 -0400
NameError (uninitialized constant ActiveModel::Validations::PresenceValidator):
activerecord (4.2.4.rc1) lib/active_record/validations/presence.rb:3:in `<module:Validations>'
activerecord (4.2.4.rc1) lib/active_record/validations/presence.rb:2:in `<module:ActiveRecord>'
activerecord (4.2.4.rc1) lib/active_record/validations/presence.rb:1:in `<top (required)>'
activerecord (4.2.4.rc1) lib/active_record/validations.rb:90:in `<top (required)>'
activerecord (4.2.4.rc1) lib/active_record/base.rb:294:in `<class:Base>'
activerecord (4.2.4.rc1) lib/active_record/base.rb:269:in `<module:ActiveRecord>'
activerecord (4.2.4.rc1) lib/active_record/base.rb:26:in `<top (required)>'
activerecord (4.2.4.rc1) lib/active_record/migration.rb:383:in `connection'
activerecord (4.2.4.rc1) lib/active_record/migration.rb:370:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.4.rc1) lib/active_support/callbacks.rb:88:in `__run_callbacks__'
activesupport (4.2.4.rc1) lib/active_support/callbacks.rb:778:in `_run_call_callbacks'
activesupport (4.2.4.rc1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
web-console (2.2.1) lib/web_console/middleware.rb:39:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.4.rc1) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.4.rc1) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.4.rc1) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.4.rc1) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.4.rc1) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.4.rc1) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.4.rc1) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.4.rc1) lib/action_dispatch/middleware/static.rb:116:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.4.rc1) lib/rails/engine.rb:518:in `call'
railties (4.2.4.rc1) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
And here is the Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.4.rc1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
end
group :development do
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
end
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
#
gem 'brakeman', '~> 3.0.5'
gem 'dawnscanner', '~> 1.3.5'
gem 'activemodel', '~> 4.2.3'
It's a last resort for me to regenerate all of the files from my website to a new app, but I'm not sure why it's happening with this new project. The only thing I've done is install two gems to help me with security, so maybe that's it but I'm not sure. Can anyone help?
I think I figured out the problem. I made a new app, without the two gems, and it worked. I went to my app and took out one of the gems (dawnscanner) and it worked.

NameError when I run my rails server

I ran the command rails server -p 8000 in the console to start my rails app, and I went to localhost:8000 in my browser, but I got an error saying something went wrong. I checked my console, and I saw this:
Started GET "/" for 127.0.0.1 at 2015-08-15 14:21:23 -0400
NameError (uninitialized constant ActiveModel::Validations::PresenceValidator):
activerecord (4.2.3) lib/active_record/validations/presence.rb:3:in `<module:Validations>'
activerecord (4.2.3) lib/active_record/validations/presence.rb:2:in `<module:ActiveRecord>'
activerecord (4.2.3) lib/active_record/validations/presence.rb:1:in `<top (required)>'
activerecord (4.2.3) lib/active_record/validations.rb:90:in `<top (required)>'
activerecord (4.2.3) lib/active_record/base.rb:294:in `<class:Base>'
activerecord (4.2.3) lib/active_record/base.rb:269:in `<module:ActiveRecord>'
activerecord (4.2.3) lib/active_record/base.rb:26:in `<top (required)>'
activerecord (4.2.3) lib/active_record/migration.rb:383:in `connection'
activerecord (4.2.3) lib/active_record/migration.rb:370:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (4.2.3) lib/active_support/callbacks.rb:84:in `run_callbacks'
actionpack (4.2.3) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/reloader.rb:73:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/remote_ip.rb:78:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.2.3) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.2.3) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `block in tagged'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (4.2.3) lib/active_support/tagged_logging.rb:68:in `tagged'
railties (4.2.3) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.6.4) lib/rack/methodoverride.rb:22:in `call'
rack (1.6.4) lib/rack/runtime.rb:18:in `call'
activesupport (4.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
actionpack (4.2.3) lib/action_dispatch/middleware/static.rb:116:in `call'
rack (1.6.4) lib/rack/sendfile.rb:113:in `call'
railties (4.2.3) lib/rails/engine.rb:518:in `call'
railties (4.2.3) lib/rails/application.rb:165:in `call'
rack (1.6.4) lib/rack/lock.rb:17:in `call'
rack (1.6.4) lib/rack/content_length.rb:15:in `call'
rack (1.6.4) lib/rack/handler/webrick.rb:88:in `service'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:138:in `service'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/httpserver.rb:94:in `run'
c:/RailsInstaller/Ruby2.1.0/lib/ruby/2.1.0/webrick/server.rb:295:in `block in start_thread'
I updated all of my gems yesterday, including rails, so I'm thinking it has something to do with that. Is there something I did wrong when I updated all of the gems? I ran the command, and then I updated the Gemfile, but did I miss anything? (Let me know if you want me to put the Gemfile in here as well)
Here's my Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.3'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
# Use ActiveModel has_secure_password
gem 'bcrypt', '~> 3.1.7'
# Use unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
# Use debugger
# gem 'debugger', group: [:development, :test]
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
gem 'tzinfo-data', platforms: [:mingw, :mswin]
# Scans for vulnerabilities
gem 'brakeman', '~> 3.0.5'
gem 'dawnscanner', '~> 1.3.5'
You have to require the whole of active_model since it uses autoload to "lazily require" classes as needed.
The following code works fine:
require 'active_model'
class Person
include ActiveModel::Validations
end
I think I figured out the problem. I made a new app, without the two gems, and it worked. I went to my app and took out one of the gems (dawnscanner) and it worked.

RoutingError with ActionController (GET)

I'm trying to set 7 directories, in 7 subdomains, using Rails + nginx + unicorn + MongoDB.
Actually, the subdomains are generated from root files by nginx and works perfectly, and I didn't use MongoDB yet.
Installations are freshly made, no pages created yet (and I also have tried with), and I still have 404 errors with an error in log.
Works if I create a html page in /public, of course.
Example:
I install one of them using rails new site1
in /var/www/site1
available on http://site1.mydomain.tld
It will display this error in /var/www/site1/log/production.log :
I, [2013-09-01T02:12:44.425694 #31368] INFO -- : Started GET "/" for XXX.XXX.XXX.XXX at 2013-09-01 02:12:44 +0200
F, [2013-09-01T02:12:44.426541 #31368] FATAL -- :
ActionController::RoutingError (No route matches [GET] "/"):
actionpack (4.0.0) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.0.0) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.0) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `block in call'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.0) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.0) lib/rails/rack/logger.rb:21:in `call'
actionpack (4.0.0) 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.0.0) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
railties (4.0.0) lib/rails/engine.rb:511:in `call'
railties (4.0.0) lib/rails/application.rb:97:in `call'
unicorn (4.6.3) lib/unicorn/http_server.rb:552:in `process_client'
unicorn (4.6.3) lib/unicorn/http_server.rb:632:in `worker_loop'
unicorn (4.6.3) lib/unicorn/http_server.rb:500:in `spawn_missing_workers'
unicorn (4.6.3) lib/unicorn/http_server.rb:142:in `start'
unicorn (4.6.3) bin/unicorn:126:in `<top (required)>'
/usr/local/bin/unicorn:23:in `load'
/usr/local/bin/unicorn:23:in `<main>'
There's my Gemfile :
source 'https://rubygems.org'
gem 'rails', '4.0.0'
gem 'bson_ext'
# mongoDB tool
## gem 'mongoid', '~> 3.0.0'
## gem 'mongo', '~> 1.9.2'
#gem 'mongo_mapper'
gem 'sqlite3'
# Use unicorn as the app server
gem 'unicorn'
# CSS tool
gem 'sass-rails', '~> 4.0.0'
## JQUERY & javascript stuff
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'jquery-rails'
gem 'jbuilder', '~> 1.2'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
group :doc do
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', require: false
end
# Use debugger
# gem 'debugger', group: [:development, :test]
My config/unicorn.rb file :
root = "/var/www/site1"
working_directory root
pid "#{root}/tmp/pids/unicorn.pid"
stderr_path "#{root}/log/uni-err.log"
stdout_path "#{root}/log/uni-out.log"
listen "/tmp/site1-unicorn.test.sock"
worker_processes 2
timeout 30
Any help would be useful. Thanks!
Probably you have made a change to your route and did not restart. In order to view these changes, you must restart the service.

ERROR: Action Controller:Exception caught when installing bootstrap / custom.css.scss

Im stuck... im going through Hartls RoR tutorial and somehow i cant get rid of a bug. All went well until the end of section 5.1.1. When i installed bootstrap and set up the custom.css.scss
ill just put here what i think u might need to answer my question. dunno any further, hope u can help me out with this one...
this is what it throws when i testrun it on localhost
ActiveRecord::ConnectionNotEstablished
ActiveRecord::ConnectionNotEstablished
Rails.root: C:/Ruby193/bin/rails_projects/sample_app
Application Trace | Framework Trace | Full Trace
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:409:in `retrieve_connection'
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_specification.rb:107:in `retrieve_connection'
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_specification.rb:89:in `connection'
activerecord (3.1.1) lib/active_record/query_cache.rb:65:in `rescue in call'
activerecord (3.1.1) lib/active_record/query_cache.rb:59:in `call'
activerecord (3.1.1) lib/active_record/connection_adapters/abstract/connection_pool.rb:477:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call'
activesupport (3.1.1) lib/active_support/callbacks.rb:392:in `_run_call_callbacks'
activesupport (3.1.1) lib/active_support/callbacks.rb:81:in `run_callbacks'
actionpack (3.1.1) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/reloader.rb:68:in `call'
rack (1.3.6) lib/rack/sendfile.rb:101:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/remote_ip.rb:48:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call'
railties (3.1.1) lib/rails/rack/logger.rb:13:in `call'
rack (1.3.6) lib/rack/methodoverride.rb:24:in `call'
rack (1.3.6) lib/rack/runtime.rb:17:in `call'
activesupport (3.1.1) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.3.6) lib/rack/lock.rb:15:in `call'
actionpack (3.1.1) lib/action_dispatch/middleware/static.rb:53:in `call'
railties (3.1.1) lib/rails/engine.rb:456:in `call'
railties (3.1.1) lib/rails/rack/content_length.rb:16:in `call'
railties (3.1.1) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.3.6) lib/rack/handler/webrick.rb:59:in `service'
C:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
C:/Ruby193/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
C:/Ruby193/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
Request
Parameters:
None
Show session dump
Show env dump
GATEWAY_INTERFACE: "CGI/1.1"
HTTP_ACCEPT: "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
HTTP_ACCEPT_ENCODING: "gzip, deflate"
HTTP_ACCEPT_LANGUAGE: "de-de,de;q=0.8,en-us;q=0.5,en;q=0.3"
REMOTE_ADDR: "127.0.0.1"
REMOTE_HOST: XXXXXXXXXXXXX
SERVER_NAME: "localhost"
SERVER_PROTOCOL: "HTTP/1.1"
Response
Headers:
None
...
This is my gemfile:
source 'https://rubygems.org'
gem 'rails', '3.2.6'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
I i tried other gem files, for example this one, also wouldnt work (though it worked in a different question here answered):
source 'http://rubygems.org'
gem 'rails', '3.1.1'
gem 'sqlite3'
group :development do
gem 'rspec-rails', '2.6.1'
end
group :test do
gem 'rspec-rails', '2.6.1'
gem 'webrat', '0.7.1'
end
group :assets do
gem 'sass-rails', '~> 3.1.4'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'

Resources