#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2006
    Posts
    162
    Rep Power
    9

    Install problem with mysql


    Hello. I am new to this stuff and i have some problem. I have winxp, apache2triad and i downloaded the ruby installer for windows. I followed the tutorial in http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html?page=1
    without re-installing mysql as i already have it. I created an empty rails application, i did the "ruby script\server" and i show the intro page. I also managed to create a controller. The problem is with the mysql. First of all i didn't see any test database. Moreover i created a database and i then go to the database.yml to see it.
    I saw "# MySQL (default setup). Versions 4.1 and 5.0 are recommended." . I expected to see something like
    development:
    adapter:
    database: etc
    If i place the code by myself and try to restart the webserver i get a message:



    C:\rails\cookbook>ruby script\server
    => Booting WEBrick...
    c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_
    adapters/abstract/connection_specification.rb:194:in `establish_connection': dev
    elopment database is not configured (ActiveRecord::AdapterNotSpecified)
    from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_recor
    d/connection_adapters/abstract/connection_specification.rb:185:in `establish_con
    nection'
    from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:182:i
    n `initialize_database'
    from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:84:in
    `process'
    from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:42:in
    `send'
    from c:/ruby/lib/ruby/gems/1.8/gems/rails-1.1.6/lib/initializer.rb:42:in
    `run'
    from ./script/../config/../config/environment.rb:13
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge
    m_original_require'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
    quire'
    ... 6 levels...
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `ge
    m_original_require'
    from c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `re
    quire'
    from c:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_suppo
    rt/dependencies.rb:147:in `require'
    from script/server:3




    Any idea?
  2. #2
  3. $foo->bar($_);
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2006
    Location
    London
    Posts
    86
    Rep Power
    54
    Please post the database.yml you used. Normally it should look like:
    Code:
    development:
      adapter: mysql
      database: example_dev
      username: ruby
      password: secret123
      host: localhost 
    
    test:
      adapter: mysql
      database: example_test
      username: ruby
      password: secret123
      host: localhost
    
    production:
      development
    Also, you need to check if you have installed the ruby-databasedriver for mysql. The default database.yml contains a hint:

    Code:
    # Install the MySQL driver:
    #   gem install mysql
    # On MacOS X:
    #   gem install mysql -- --include=/usr/local/lib
    # On Windows:
    #   There is no gem for Windows.  Install mysql.so from RubyForApache.
    #   http://rubyforge.org/projects/rubyforapache
    bye,
    grande
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Posts
    1
    Rep Power
    0

    Install problem with mysql


    Hi grande!

    I have the same problem and I could not understand your solution, can you explain more about "Install mysql.so from RubyForApache", how to install it?
    thaQ!
    - Navid

IMN logo majestic logo threadwatch logo seochat tools logo