I have a problem with setting up rails application. We use rails 3 (we also use memcached), and have I installed everthing (DB, ruby, rubygems, rails, ...) and configure the DB. So if I run rails server the apllication starts ok.
For production we will use Apache and Phusion Passenger, both have been installed sucessfuly. When I restart apache I get this error:
*
[ pid=1557 thr=-608134948 file=utils.rb:176 time=2011-08-13 12:51:05.974 ]: *** Exception NameError in PhusionPassenger::Rack::ApplicationSpawner (undefined local variable or method `application_controller' for main:Object) (process 1557, thread #<Thread:0xb78131b8>):
from /media/Disc/ABC/CODE/TESTINGAPP/app/controllers/application.rb:1
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:227:in `load_dependency'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in `require'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:346:in `require_or_load'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:300:in `depend_on'
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:216:in `require_dependency'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:138:in `eager_load!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:137:in `each'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:137:in `eager_load!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:135:in `each'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/engine.rb:135:in `eager_load!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:108:in `eager_load!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application/finisher.rb:41
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `run_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `send'
from /usr/lib/ruby/gems/1.8/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
from /media/Disc/ABC/CODE/TESTINGAPP/config/environment.rb:5
from config.ru:3:in `require'
from config.ru:3
from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /usr/lib/ruby/gems/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from config.ru:1:in `new'
from config.ru:1
*
First I thought that it might be sometnig with memcached, like some missing module for apache, but I read that there is no configuration needed for apache/passenger.
My question is, why application doesn't start? Have I forgot to install or configure someting? I really don't know what might be wronge since the application starts ok with rails server.
Tnx in advance ;)
Look at this file:
/media/Disc/ABC/CODE/TESTINGAPP/app/controllers/application.rb
Since Rails 2.3 this file should be called application_controller.rb and not application.rb. Rename the file and it should work:
/media/Disc/ABC/CODE/TESTINGAPP/app/controllers/application_controller.rb
Related
I'm a beginner to appium, or even the language node.js or ruby. So I completely follow the tutorial when installing appium. When I ran the command arc, got the error:
/Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/2.1.0/net/http/generic_request.rb:27:in `initialize': HTTP request path is empty (ArgumentError)
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/2.1.0/net/http/request.rb:14:in `initialize'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:71:in `new'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:71:in `new_request_for'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:35:in `request'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/default.rb:64:in `request'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/http/common.rb:40:in `call'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_lib-5.0.0/lib/appium_lib/common/patch.rb:118:in `raw_execute'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:101:in `create_session'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/remote/bridge.rb:68:in `initialize'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:33:in `new'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver/common/driver.rb:33:in `for'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/selenium-webdriver-2.44.0/lib/selenium/webdriver.rb:67:in `for'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_lib-5.0.0/lib/appium_lib/driver.rb:477:in `start_driver'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_console-1.0.3/lib/start.rb:16:in `<top (required)>'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:96:in `block in load_requires'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:95:in `each'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:95:in `load_requires'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:117:in `initial_session_setup'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/pry_class.rb:142:in `start'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/cli.rb:201:in `block in <top (required)>'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/cli.rb:70:in `call'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/cli.rb:70:in `block in parse_options'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/cli.rb:70:in `each'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/pry-0.9.12.6/lib/pry/cli.rb:70:in `parse_options'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_console-1.0.3/lib/appium_console.rb:49:in `<module:Console>'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_console-1.0.3/lib/appium_console.rb:31:in `<module:Appium>'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_console-1.0.3/lib/appium_console.rb:30:in `<top (required)>'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /Users/kenmux/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/appium_console-1.0.3/bin/arc:66:in `<top (required)>'
from /Users/kenmux/.rbenv/versions/2.1.5/bin/arc:23:in `load'
from /Users/kenmux/.rbenv/versions/2.1.5/bin/arc:23:in `<main>'
Then what should I do? Am I missing something? I just cannot get over it!
I had this same issue when I was at work and had a proxy server in my .bash_profile
Open up a terminal and type:
cat ~/.bash_profile
That will show you what is in your profile.
my .bash_profile had the below.
export http_proxy="http://127.0.0.1:8888"
export https_proxy=$http_proxy
export ftp_proxy=$http_proxy
export rsync_proxy=$http_proxy
To comment them out just add # in front of each of the lines. Then restart your terminal session.
Side Note:
When you type user$ arc from the terminal you will want to make sure you have appium running and the appium.txt file in the same directory where your running arc.
Lots of good stuff here -> Ruby_Console
I hope that helps you or someone else.
I went to restart my rails server today and when I went to fire it back up here's the error I got. I've tried everything and haven't been able to crack it. I uninstalled and reinstalled activesupport 3.1.0, and it seems like there's an error in activesupport itself, which I doubt I can fix. So, color me confused (paint me perplexed). Any advice much appreciated.
$ RESQUE_INTERFACE=true rails s
=> Booting WEBrick
=> Rails 3.1.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load': /Users/nickgoddard/codebase/newshop/config/initializers/session_store.rb:3: syntax error, unexpected ':', expecting $end (SyntaxError)
...sion_store :cookie_store, key: '_newshop_session'
^
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:234:in `load'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/engine.rb:555
from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/engine.rb:554:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/engine.rb:554
from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `run'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/initializable.rb:50:in `run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `each'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/initializable.rb:49:in `run_initializers'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/application.rb:92:in `initialize!'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `send'
from /Library/Ruby/Gems/1.8/gems/railties-3.1.0/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /Users/nickgoddard/codebase/newshop/config/environment.rb:5
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /Library/Ruby/Gems/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /Users/nickgoddard/codebase/newshop/config.ru:4
from /Library/Ruby/Gems/1.8/gems/rack-1.3.6/lib/rack/builder.rb:51:in `instance_eval'
from /Library/Ruby/Gems/1.8/gems/rack-1.3.6/lib/rack/builder.rb:51:in `initialize'
from /Users/nickgoddard/codebase/newshop/config.ru:1:in `new'
from /Users/nickgoddard/codebase/newshop/config.ru:1
You're trying to run Ruby 1.9 code on Ruby 1.8, specifically the session_store hash parameters.
Usually, when you create a new Rails app, it should know this, but I'm not sure of the specifics about how you set up your app (or maybe you cloned someone else's?). To create an app and force it to use the 1.8 style of hashes, do:
rails new my_app --old-style-hash
Or, you can use something like rvm or rbenv to install Ruby 1.9 and use that instead.
I was looking to deploy my first rails app, and have been experiencing some issues. First off, everything works fine in the development server, so I figured I was good to go. After failed to deploy the app to my host, I tried to launch the server in production mode for the first time, receiving several errors.
Out of curiousity, I created a new app, completely fresh without me editing any code. I'm getting pretty much the same errors about my database:
/home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection': =production database is not configured (ActiveRecord::AdapterNotSpecified)
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/railtie.rb:59:in `block (2 levels) in <class:Railtie>'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:26:in `on_load'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/activerecord-3.0.3/lib/active_record/railtie.rb:57:in `block in <class:Railtie>'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `block in run_initializers'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
from /home/sweiss/testapp/config/environment.rb:6:in `<top (required)>'
from /home/sweiss/testapp/config.ru:3:in `require'
from /home/sweiss/testapp/config.ru:3:in `block in <main>'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /home/sweiss/testapp/config.ru:1:in `new'
from /home/sweiss/testapp/config.ru:1:in `<main>'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands/server.rb:65:in `start'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:30:in `block in <top (required)>'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap'
from /home/sweiss/.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.3/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
Has anyone experiences this while trying to launch a production server? The database.yml, just for good measure, is the following default for sqlite3:
production:
adapter: sqlite3
database: db/production.sqlite3
pool: 5
timeout: 5000
I verified the .yml had no tabs (not that it should auto-generated).
Anyway, I appreciate the help.
Have you installed the sqlite3 gem? Sounds to me like it can't find the adapter.
I'm a Ruby nuby (and new to Stack Overflow) working on the Rails Tutorial by Michael Hartl and all of a sudden my development server won't load and keeps exiting. Console also won't load and Rspec spec/ produces errors/exceptions. I am including some output from the terminal, your help is much appreciated.
Exiting
/Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:164:in `default_controller_and_action': missing :action (ArgumentError)
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:68:in `normalize_options!'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:51:in `initialize'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:261:in `new'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:261:in `match'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:1112:in `match'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/mapper.rb:1297:in `match'
from /Users/ameedachowdhury/rails_projects/railstutorial/config/routes.rb:11:in `block in <top (required)>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/route_set.rb:233:in `instance_exec'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/actionpack-3.0.3/lib/action_dispatch/routing/route_set.rb:233:in `draw'
from /Users/ameedachowdhury/rails_projects/railstutorial/config/routes.rb:1:in `<top (required)>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `block in load'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `block in load_dependency'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in `new_constants_in'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in `load_dependency'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in `load'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:127:in `block in reload_routes!'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:127:in `each'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:127:in `reload_routes!'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:120:in `block in routes_reloader'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/file_update_checker.rb:32:in `call'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/activesupport-3.0.3/lib/active_support/file_update_checker.rb:32:in `execute_if_updated'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application/finisher.rb:51:in `block (2 levels) in <module:Finisher>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application/finisher.rb:52:in `call'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application/finisher.rb:52:in `block in <module:Finisher>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/initializable.rb:25:in `run'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/initializable.rb:50:in `block in run_initializers'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `each'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/initializable.rb:49:in `run_initializers'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:134:in `initialize!'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/application.rb:77:in `method_missing'
from /Users/ameedachowdhury/rails_projects/railstutorial/config/environment.rb:5:in `<top (required)>'
from /Users/ameedachowdhury/rails_projects/railstutorial/config.ru:3:in `require'
from /Users/ameedachowdhury/rails_projects/railstutorial/config.ru:3:in `block in <main>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /Users/ameedachowdhury/rails_projects/railstutorial/config.ru:1:in `new'
from /Users/ameedachowdhury/rails_projects/railstutorial/config.ru:1:in `<main>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/builder.rb:35:in `eval'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/builder.rb:35:in `parse_file'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/server.rb:162:in `app'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/server.rb:248:in `wrapped_app'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/rack-1.2.1/lib/rack/server.rb:213:in `start'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/commands/server.rb:65:in `start'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/commands.rb:30:in `block in <top (required)>'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/commands.rb:27:in `tap'
from /Users/ameedachowdhury/.rvm/gems/ruby-1.9.2-p0#rails3tutorial/gems/railties-3.0.3/lib/rails/commands.rb:27:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
ameeda-chowdhurys-macbook:railstutorial ameedachowdhury$
When I ran into this problem, it was because one of the routes in routes.rb had a slash (/) instead of the hash (#) when using the controller#action syntax (I used "controller/action", which was incorrect).
For example, I accidentally had root :to => 'home/index'. It was supposed to be root :to => 'home#index'.
I found this solution in here.
This is caused by incorrect routes -
Please check your config/routes.rb , even if one route mentioned is wrong then this error is thrown !!
Also make sure that the route is
'/url/for/something' => 'controller#action'
or
root :to => 'controller#action
I'm also a Ruby nuby and had the same error while working on the Rails Tutorial by Michael Hartl. If you're like me, you might be just typing in all code that appears in the book with really reading or understanding the text. Not everything is step by step. In demonstrating camel case vs. snake case Hartl shows a box with the following code
$ rails generate controller static_pages ...
Here, Hartl is simply trying to contrast instructions to generate a StaticPages controller using snake case, rather than camel case, which was done in Listing 3.4. The dots "..." are simply to edit out or truncate the rest of the instructions for the cmd line. I typed in exactly what was shown and wound up with the following in my routes file:
SampleApp::Application.routes.draw do
get "static_pages/..."
get "static_pages/home"
get "static_pages/help"
open up your routes file, delete
get "static_pages/..."
save the routes file, and try starting rails server again.
I also destroyed "rails generate controller static_pages ..." Not sure if that had any effect, but now everything works.
By default you get this:
Rails.application.routes.draw do
get 'static_pages/...'
get 'static_pages/home'
get 'static_pages/help'
JUST ERASE THIS:
get 'static_pages/...'
AND YOU WILL HAVE THIS IN THE ROUTES.RB FILE
Rails.application.routes.draw do
get 'static_pages/home'
get 'static_pages/help'
In my case it was caused by the suffix slash '/' in some of my routes. E.g.
post 'load_query/'
After removing this suffix to
post 'load_query'
it worked.
change your default root in the routes.rb file.
get "static_pages#home" TO root to: 'static_pages#home'
I've gone through the same issue, and the above change worked for me.
I got this error when I start my project with memcache (gem) and rails 3.0.0beta
Here's the full trace:
/Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache/mem_cache_store.rb:39:in `build_mem_cache': uninitialized constant ActiveSupport::Cache::MemCacheStore::MemCache (NameError)
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache/mem_cache_store.rb:65:in `initialize'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache.rb:64:in `new'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/cache.rb:64:in `lookup_store'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application/bootstrap.rb:47
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:22:in `with_warnings'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/activesupport-3.0.0.beta4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application/bootstrap.rb:47
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:25:in `run'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:55:in `run_initializers'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:54:in `each'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:119:in `initialize!'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:81:in `send'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/railties-3.0.0.beta4/lib/rails/application.rb:81:in `method_missing'
from /Users/netbe/Projects/banana/config/environment.rb:5
from config.ru:3:in `require'
from config.ru:3
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/builder.rb:46:in `instance_eval'
from /Users/netbe/.rvm/gems/ruby-1.8.7-p249/gems/rack-1.1.0/lib/rack/builder.rb:46:in `initialize'
from config.ru:1:in `new'
from config.ru:1
Here's some code from my environment.rb, line #5 : module Cache
require 'active_support/cache'
module ActiveSupport
module Cache
class MemCacheStore < Store
def logger
Rails.logger
end
end
end
end
Is there anyone who can guess what's wrong here, is it a rails 3 issue?
actually you have not added gem "memcache-client" to your Gemfile, apparently you only have gem "memcache"
I think my answer is too late :) But may be it's help somebody. I've got same error and the problem was in name of the file in lib/memcache.rb directory. After renaming it, project started as usual.