Hello I am rather new to Ruby and have been following along with the book "Ruby On Rails 3 Tutorial - Learn Ruby by Example - by Michael Hartl". I am currently in Chapter 3 which discusses static pages. In this chapter, I entered the following command into the prompt: "rails generate controller Pages home contact" and everything worked fine. Then the book directs me to http://localhost:3000/pages/home. When I point my browser there, I receive the following error. ActiveRecord::ConnectionNotEstablished ActiveRecord::ConnectionNotEstablished Rails.root: /home/ralph/railsprojects/sample_app Application Trace | Framework Trace | Full Trace The routes and controller erb don''t appear to have any errors. Is this a database related error? Any ideas? Thanks, DMAT -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
what''s the url for your git repo.... I''ll take a look at it.... off the top of my head, it shouldn''t be a db issue as there''s no db at that point of the tutorial... a quick google did make it sound like a db issue... but i can''t tell much unless i can look at the source On Oct 23, 10:12 pm, DMAT <dmatuz2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello > > I am rather new to Ruby and have been following along with the book > "Ruby On Rails 3 Tutorial - Learn Ruby by Example - by Michael Hartl". > I am currently in Chapter 3 which discusses static pages. In this > chapter, I entered the following command into the prompt: "rails > generate controller Pages home contact" and everything worked fine. > Then the book directs me tohttp://localhost:3000/pages/home. When I > point my browser there, I receive the following error. > > ActiveRecord::ConnectionNotEstablished > > ActiveRecord::ConnectionNotEstablished > Rails.root: /home/ralph/railsprojects/sample_app > > Application Trace | Framework Trace | Full Trace > > The routes and controller erb don''t appear to have any errors. Is this > a database related error? Any ideas? > > Thanks, > DMAT-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I have the exact same problem in chapter 3. I went over everything that I could think can go wrong but wasn''t successful. This is my github directory : https://github.com/justfarnaz/sample_app Really appreciate the help Max. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I am having similar issues regarding ConnectionNotEstablished. Anyone able to resolve this problem? Appreciate any help. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Thu, Nov 3, 2011 at 3:16 AM, Waseem Khan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I am having similar issues regarding ConnectionNotEstablished. Anyone > able to resolve this problem? Appreciate any help. >Please send the exact error message. If you doubt if the database.yml file is correct, you could do this test: <code> $ cd config $ irb 001:0> require ''yaml'' => true 002:0> d = YAML.load(File.open(''database.yml'')) => {"development"=>{"adapter"=>"postgresql", "encoding"=>"unicode", ...}} 003:0> quit $ vim database.yml # place an incorrect TAB $ irb 001:0> require ''yaml'' => true 002:0> d = YAML.load(File.open(''database.yml'')) Psych::SyntaxError: (database.yml): couldn''t parse YAML at line 6 column 0 from /home/peterv/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:154:in `parse'' from /home/peterv/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:154:in `parse_stream'' from /home/peterv/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:125:in `parse'' from /home/peterv/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/psych.rb:112:in `load'' from (irb):2 from /home/peterv/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>'' This way, at least you can make sure your database.yml file is correctly formatted. You may also show us your database.yml file (but empty the password line ...). HTH, Peter -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Check your log/development.log I''m sure there is something there -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/EYWexgUjVr4J. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I''m actually having the same problem running through the tutorial exercises. I suspect it actually has something to do with RSpec as I can''t understand why it''s trying to access the database as all the pages are static. Additionally, the previous example in the tutorial which contained database calls worked fine but I didn''t have RSpec installed at the time. I tried to run rake db:create and get the following error message. $ rake db:create --trace rake aborted! undefined method `prerequisites'' for nil:NilClass /Users/RKessler/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/rspec-rails-2.0.1/lib/rspec/rails/tasks/rspec.rake:3:in `<top (required)>'' /Users/RKessler/.rvm/gems/ruby-1.9.2-p290@rails3tutorial/gems/rspec-rails-2.0.1/lib/rspec-rails.rb:10:in `load'' Any help would be greatly appreciated. Thanks. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I had the same problem today as you described, and this is how I solved it. I''m not sure if this is the "best" or most appropriate solution, but it worked. I changed my Gemfile and added the sqlite3 gem. After restarting the server and reloading the page I received a new error: ActionView::Template::Error (couldn''t find file ''jquery'' So, I went back to the Gemfile again and added the jquery-ruby gem. This time everything worked as expected. Maybe this has something do do with the version of Rails and Ruby I/we have running? I''m running the following: ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0] Rails 3.1.1 Below is my Gemfile for the curious. Using this my sample app is working fine now. - Pete ------------------------- source ''http://rubygems.org'' gem ''rails'', ''3.1.1'' # Bundle edge Rails instead: # gem ''rails'', :git => ''git://github.com/rails/rails.git'' gem ''sqlite3'' gem ''sqlite3-ruby'', ''1.3.1'', :require => ''sqlite3'' gem ''jquery-rails'' group :development do gem ''rspec-rails'', ''2.0.1'' end group :test do gem ''rspec'', ''2.0.1'' gem ''webrat'', ''0.7.1'' end ------------------------- -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
change sqlite3-ruby with sqlite2 on Gemfile -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Peter P. wrote in post #1032037:> I had the same problem today as you described, and this is how I solved > it. I''m not sure if this is the "best" or most appropriate solution, but > it worked. > > I changed my Gemfile and added the sqlite3 gem. After restarting the > server and reloading the page I received a new error: > > ActionView::Template::Error (couldn''t find file ''jquery'' > > So, I went back to the Gemfile again and added the jquery-ruby gem. > This time everything worked as expected. Maybe this has something do do > with the version of Rails and Ruby I/we have running? I''m running the > following: > > ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.2.0] > Rails 3.1.1 > > Below is my Gemfile for the curious. Using this my sample app is working > fine now. > > - Pete > > ------------------------- > source ''http://rubygems.org'' > > gem ''rails'', ''3.1.1'' > > # Bundle edge Rails instead: > # gem ''rails'', :git => ''git://github.com/rails/rails.git'' > > gem ''sqlite3'' > gem ''sqlite3-ruby'', ''1.3.1'', :require => ''sqlite3'' > gem ''jquery-rails'' > > group :development do > gem ''rspec-rails'', ''2.0.1'' > end > > group :test do > gem ''rspec'', ''2.0.1'' > gem ''webrat'', ''0.7.1'' > end > -------------------------Thanx! I had to slightly mod my Gemfile from what have, but now it works! My Gemfile: source ''http://rubygems.org'' gem ''rails'', ''3.1.1'' # Bundle edge Rails instead: # gem ''rails'', :git => ''git://github.com/rails/rails.git'' gem ''sqlite3'' gem ''sqlite3-ruby'', ''1.3.1'', :require => ''sqlite3'' gem ''jquery-rails'' group :development do gem ''rspec-rails'', ''2.0.1'' end group :test do gem ''rspec'', ''2.0.1'' gem ''webrat'', ''0.7.1'' end # in production environments by default. group :assets do gem ''sass-rails'', ''~> 3.1.4'' gem ''coffee-rails'', ''~> 3.1.1'' gem ''uglifier'', ''>= 1.0.3'' -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.