Ruby on Rails Wednesday, June 25, 2014

Antonio,

  Thanks for your response.  That error code makes a bit more sense to me now, I appreciate your response.
  Here are the contents of my development.rb file

Rails.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


As far as I can tell, the first line is not missing and loads a method known as configure.  I however did not write a configure method, nor did the railstutorial outline the need for one...  I can see the problem is now that this configure method is undefined, but how do I go about resolving this?

Much obliged,
Will

On Wednesday, June 25, 2014 12:41:32 AM UTC-4, Antônio Augusto Sousa Britto wrote:
Look at what the error is telling you:

C:/Sites/rails_projects/first_app/config/environments/development.rb:1:in `<top
(required)>': undefined method `configure' for #<FirstApp::Application:0x273df20
> (NoMethodError)


Generally, the exception is "NoMethodError" means that the interpreter was not able to find a method (in this case "configure") in a specific file (in this case "development.rb". It even tells you the line, which is after the colon "1").

Can you provide the contents of the development.rb file and of any other file that you perhaps are "requiring" inside of it ? 



2014-06-24 16:13 GMT-03:00 Will Acheson <willy...@gmail.com>:
Hello everyone,

 I am a total beginner to ruby and rails, but am really excited about learning the environment.  I have to say, however, starting up with RoR is certainly most difficult!  
 
I am following along the Ruby on Rails tutorial found at railstutorial.org and I have gotten stuck at step 1.2.5.  I am running on a windows 8 environment using cmd.exe and sublime text 2 for text editing.  I have updated my gemfile in my first_app project to exactly as it says to do in the railstutorial and have ran 'bundle update' & 'bundle install' and that seems to be correct, to me.  
My gemfile looks like:
  
ruby '1.9.3'
#ruby-gemset=railstutorial_rails_4_0

gem 'rails', '4.0.5'

group :development do
  gem 'sqlite3', '1.3.8'
end

gem 'sass-rails', '4.0.1'
gem 'uglifier', '2.1.1'
gem 'coffee-rails', '4.0.1'
gem 'jquery-rails', '3.0.4'
gem 'turbolinks', '1.1.1'
gem 'jbuilder', '1.0.2'

group :doc do
  gem 'sdoc', '0.3.20', require: false
end
Which is exactly as it appears in the gemfile editing step of 1.5 in the railstutorial...

With my gemfile in order and bundled, I type the command 'rails server' and my console spits out a bunch of extra code which is not listed in the tutorial.  
  Tutorial says my output should look like:
$ rails server
=> Booting WEBrick
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
  But my console outputs much more than that...
C:\Sites\rails_projects\first_app>rails server
=> Booting WEBrick
=> Rails 4.0.5 application starting in development on http://0.0.0.0:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
Exiting
C:/Sites/rails_projects/first_app/config/environments/development.rb:1:in `<top
(required)>': undefined method `configure' for #<FirstApp::Application:0x273df20
> (NoMethodError)
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
4.0.5/lib/active_support/dependencies.rb:229:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
4.0.5/lib/active_support/dependencies.rb:229:in `block in require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
4.0.5/lib/active_support/dependencies.rb:214:in `load_dependency'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-
4.0.5/lib/active_support/dependencies.rb:229:in `require'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/engine.rb:591:in `block (2 levels) in <class:Engine>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/engine.rb:590:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/engine.rb:590:in `block in <class:Engine>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/initializable.rb:30:in `instance_exec'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/initializable.rb:30:in `run'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/initializable.rb:55:in `block in run_initializers'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:150:in `block i
n tsort_each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:183:in `block (
2 levels) in each_strongly_connected_component'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:210:in `block (
2 levels) in each_strongly_connected_component_from'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:219:in `each_st
rongly_connected_component_from'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:209:in `block i
n each_strongly_connected_component_from'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/initializable.rb:44:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/initializable.rb:44:in `tsort_each_child'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:203:in `each_st
rongly_connected_component_from'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:182:in `block i
n each_strongly_connected_component'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:180:in `each_st
rongly_connected_component'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/tsort.rb:148:in `tsort_e
ach'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/initializable.rb:54:in `run_initializers'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/application.rb:215:in `initialize!'
        from C:/Sites/rails_projects/first_app/config/environment.rb:5:in `<top
(required)>'
        from C:/Sites/rails_projects/first_app/config.ru:3:in `require'
        from C:/Sites/rails_projects/first_app/config.ru:3:in `block in <main>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib
/rack/builder.rb:55:in `instance_eval'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib
/rack/builder.rb:55:in `initialize'
        from C:/Sites/rails_projects/first_app/config.ru:in `new'
        from C:/Sites/rails_projects/first_app/config.ru:in `<main>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib
/rack/builder.rb:49:in `eval'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib
/rack/builder.rb:49:in `new_from_string'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib
/rack/builder.rb:40:in `parse_file'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib
/rack/server.rb:277:in `build_app_and_options_from_config'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib
/rack/server.rb:199:in `app'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/commands/server.rb:48:in `app'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/rack-1.5.2/lib
/rack/server.rb:314:in `wrapped_app'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/commands/server.rb:75:in `start'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/commands.rb:76:in `block in <top (required)>'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/commands.rb:71:in `tap'
        from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.0.5
/lib/rails/commands.rb:71:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

So after this I attempt to point my browser to the localhost server which I have supposedly created @ http://0.0.0.0:3000  
At this point, I get the "webpage is not available" / "oops! Google chrome cannot connect to localhost:3000" error page...

Is there some readily aparant thing I am doing wrong here?  I installed ruby using the Rails Installer for windows utility, if that makes any difference.  I have Java installed, which the author of railstutorial mentions may be an issue in respect to javascript... 

Can anyone help me?  

Best regards,
Will


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/9ebada97-ce94-4202-900c-c36a8ab9b3d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Att, Antônio Augusto de Sousa Britto - 43ª turma de Ciência da Computação - UFU

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/a0ec8cf3-a2d7-4793-9936-c05a34952c34%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment