Hi , I am new to ruby on rails. I have Windows Xp Rails 2.3.4 MySql I am not able to start webrick server I have followed steps for creating new project given http://guides.rubyonrails.org/getting_started.html rails abhi_blog -d mysql cd abhi_blog Issue 1: when i run below command, ruby script/generate controller home index I am getting this error C:\Ruby\Abhi_My Ruby\Ruby on Rails\abhi_blog>ruby script/generate controller hom e index C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load'': syntax error on line 24, col 2: ` h ost: localhost'' (ArgumentError) from C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ initializer.rb:902:i n `database_configuration'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ initializer.rb:437:i n `initialize_database'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ initializer.rb:141:i n `process'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ initializer.rb:113:i n `send'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ initializer.rb:113:i n `run'' from C:/Ruby/Abhi_My Ruby/Ruby on Rails/abhi_blog/config/ environment.rb: 9 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `ge m_original_require'' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `re quire'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/ generate.rb :1 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `ge m_original_require'' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `re quire'' from script/generate:3 Issue 2: When i try to start the server ruby script/server C:\Ruby\Abhi_My Ruby\Ruby on Rails\abhi_blog>ruby script/server => Booting WEBrick => Rails 2.3.4 application starting on http://0.0.0.0:3000 C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load'': syntax error on line 24, col 2: ` h ost: localhost'' (ArgumentError) from C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ initializer.rb:902:i n `database_configuration'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ initializer.rb:437:i n `initialize_database'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ initializer.rb:141:i n `process'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ initializer.rb:113:i n `send'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ initializer.rb:113:i n `run'' from C:/Ruby/Abhi_My Ruby/Ruby on Rails/abhi_blog/config/ environment.rb: 9 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `ge m_original_require'' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `re quire'' from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/ active_suppo rt/dependencies.rb:156:in `require'' from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/ active_suppo rt/dependencies.rb:521:in `new_constants_in'' from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/ active_suppo rt/dependencies.rb:156:in `require'' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/ server.rb:8 4 from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `ge m_original_require'' from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: 31:in `re quire'' from script/server:3 -- 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.
Did you configure the database: http://guides.rubyonrails.org/getting_started.html#configuring-a-database Darian Shimy -- http://www.darianshimy.com http://twitter.com/dshimy On Wed, Nov 25, 2009 at 8:17 AM, abhisheksreepal <abhisheksreepal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi , > > I am new to ruby on rails. > I have > Windows Xp > Rails 2.3.4 > MySql > > I am not able to start webrick > server > > I have followed steps for creating new > project given > http://guides.rubyonrails.org/getting_started.html > > > rails abhi_blog -d mysql > cd abhi_blog > > Issue 1: when i run below command, > ruby script/generate controller home index > > I am getting this error > C:\Ruby\Abhi_My Ruby\Ruby on Rails\abhi_blog>ruby script/generate > controller hom > e index > C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load'': syntax error on line 24, > col 2: ` h > ost: localhost'' (ArgumentError) > from C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ > initializer.rb:902:i > n `database_configuration'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ > initializer.rb:437:i > n `initialize_database'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ > initializer.rb:141:i > n `process'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ > initializer.rb:113:i > n `send'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ > initializer.rb:113:i > n `run'' > from C:/Ruby/Abhi_My Ruby/Ruby on Rails/abhi_blog/config/ > environment.rb: > 9 > from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 31:in `ge > m_original_require'' > from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 31:in `re > quire'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/ > generate.rb > :1 > from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 31:in `ge > m_original_require'' > from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 31:in `re > quire'' > from script/generate:3 > > > > > Issue 2: When i try to start the server > ruby script/server > > C:\Ruby\Abhi_My Ruby\Ruby on Rails\abhi_blog>ruby script/server > => Booting WEBrick > => Rails 2.3.4 application starting on http://0.0.0.0:3000 > C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load'': syntax error on line 24, > col 2: ` h > ost: localhost'' (ArgumentError) > from C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ > initializer.rb:902:i > n `database_configuration'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ > initializer.rb:437:i > n `initialize_database'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ > initializer.rb:141:i > n `process'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ > initializer.rb:113:i > n `send'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/ > initializer.rb:113:i > n `run'' > from C:/Ruby/Abhi_My Ruby/Ruby on Rails/abhi_blog/config/ > environment.rb: > 9 > from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 31:in `ge > m_original_require'' > from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 31:in `re > quire'' > from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/ > active_suppo > rt/dependencies.rb:156:in `require'' > from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/ > active_suppo > rt/dependencies.rb:521:in `new_constants_in'' > from C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/ > active_suppo > rt/dependencies.rb:156:in `require'' > from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/ > server.rb:8 > 4 > from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 31:in `ge > m_original_require'' > from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb: > 31:in `re > quire'' > from script/server:3 > > > > > -- > > 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. > > >-- 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.
Hi Darian, I have configured my database.This is my database.yml development: adapter: mysql encoding: utf8 reconnect: false database: abhidb pool: 5 username: root password:root host: localhost # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: mysql encoding: utf8 reconnect: false database: abhidb pool: 5 username: root password:root host: localhost production: adapter: mysql encoding: utf8 reconnect: false database: abhidb pool: 5 username: root password: root host: localhost -- 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.
Not sure if this will help, but try adding a space between the password: From this: password:root to this: password: root Darian Shimy -- http://www.darianshimy.com http://twitter.com/dshimy On Wed, Nov 25, 2009 at 11:26 PM, abhishek sreepal <abhisheksreepal-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi Darian, > I have configured my database.This is my database.yml > development: > adapter: mysql > encoding: utf8 > reconnect: false > database: abhidb > pool: 5 > username: root > password:root > host: localhost > # Warning: The database defined as "test" will be erased and > # re-generated from your development database when you run "rake". > # Do not set this db to the same as development or production. > test: > adapter: mysql > encoding: utf8 > reconnect: false > database: abhidb > pool: 5 > username: root > password:root > host: localhost > production: > adapter: mysql > encoding: utf8 > reconnect: false > database: abhidb > pool: 5 > username: root > password: root > host: localhost > > > -- > > 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. >-- 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.
> > Hi Darian, >Thanks for the solution. It worked. -- 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.