Reputation: 29
Im not able to get my rails server started been searching for hours now. Can anyone help?I have added the code bellow
/Users/Iain/rails_projects/ali_bodill_photogrphy/config/environments/development.rb:1:in `<top (required)>': undefined local variable or method `ali_bodill_photogrphy' for main:Object (NameError)
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `block in require'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/engine.rb:590:in `each'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/engine.rb:590:in `block in <class:Engine>'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:30:in `instance_exec'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:30:in `run'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:55:in `block in run_initializers'
from /Users/Iain/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:150:in `block in tsort_each'
from /Users/Iain/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:183:in `block (2 levels) in each_strongly_connected_component'
from /Users/Iain/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:210:in `block (2 levels) in each_strongly_connected_component_from'
from /Users/Iain/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:219:in `each_strongly_connected_component_from'
from /Users/Iain/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:209:in `block in each_strongly_connected_component_from'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:44:in `each'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:44:in `tsort_each_child'
from /Users/Iain/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:203:in `each_strongly_connected_component_from'
from /Users/Iain/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:182:in `block in each_strongly_connected_component'
from /Users/Iain/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:180:in `each'
from /Users/Iain/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:180:in `each_strongly_connected_component'
from /Users/Iain/.rvm/rubies/ruby-2.0.0-p481/lib/ruby/2.0.0/tsort.rb:148:in `tsort_each'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/initializable.rb:54:in `run_initializers'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/railties-4.0.8/lib/rails/application.rb:215:in `initialize!'
from /Users/Iain/rails_projects/ali_bodill_photogrphy/config/environment.rb:5:in `<top (required)>'
from /Users/Iain/rails_projects/ali_bodill_photogrphy/config.ru:3:in `require'
from /Users/Iain/rails_projects/ali_bodill_photogrphy/config.ru:3:in `block in <main>'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `instance_eval'
from /Users/Iain/.rvm/gems/ruby-2.0.0-p481@railstutorial_rails_4_0/gems/rack-1.5.2/lib/rack/builder.rb:55:in `initialize'
from /Users/Iain/rails_projects/ali_bodill_photogrphy/config.ru:in `new'
from /Users/Iain/rails_projects/ali_bodill_photogrphy/config.ru:in `<main>'
Im really new to this.
ali_bodill_photogrphy.application.configure do
# Settings specified here will take precedence over those in config/application.rb.
# In the development environment your application's code is reloaded on
# every request. This slows down response time but is perfect for development
# since you don't have to restart the web server when you make code changes.
config.cache_classes = false
# Do not eager load code on boot.
config.eager_load = false
# Show full error reports and disable caching.
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
# Don't care if the mailer can't send.
config.action_mailer.raise_delivery_errors = false
# Print deprecation notices to the Rails logger.
config.active_support.deprecation = :log
# Raise an error on page load if there are pending migrations.
config.active_record.migration_error = :page_load
# Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large
# number of complex assets.
config.assets.debug = true
# Adds additional error checking when serving assets at runtime. # Checks for improperly declared sprockets dependencies. # Raises helpful error messages. config.assets.raise_runtime_errors = true
# Raises error for missing translations # config.action_view.raise_on_missing_translations = true end
Upvotes: 0
Views: 437
Reputation: 76774
Since you're new, let tell you about the debugging process
--
Error
The error is shown here (first line):
undefined local variable or method `ali_bodill_photogrphy' for main:Object (NameError)
The fundamental bottom line with "computer" related problems is there has to be a logical cause of the error. The logical place to begin looking for the causes of the problem is to identify what the problem is; hence looking for the error message
In your case, the message says that you don't have the method ali_bodill_photography
on line 1
of your config/environments/development.rb
:
ali_bodill_photogrphy.application.configure do
--
Fix
This is a problem with the core of Rails. If you've changed this file, you'll want to change it back; or look at the other files to gauge what the "correct" method needs to be.
I'll give you some examples from our Rails 4 apps:
#config/environments/development.rb (4.1.4)
Rails.application.configure do
#config/environments/development.rb (4.0.0)
Appname::Application.configure do
#config/environments/development.rb (3.2)
AppName::Application.configure do
Based on the above files, I would recommend looking at your version of Rails, and amending the top of your development.rb
file to replicate either of the above examples
So if you have Rails 4.1.4 (the latest), you can just replace your all_bodill_photograph
with Rails
. If you have a lesser version of Rails, it looks like you'l need to use a constantized version of your application's name - AppName::Application
Upvotes: 3