2012-03-01 35 views
1

Ruby on Railsの新機能で、この単純なアプリケーションで作業していました。Ruby on rails beginner

私はこのエラーを取得メートル:

以下
[email protected]:~$ ruby ./Bookmarker/script/generate scaffold Bookmark 
/home/asad/Bookmarker/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:60:in `establish_connection': adapter:mysql2 database:bookmarker host:localhost username:root password:*** database is not configured (ActiveRecord::AdapterNotSpecified) 
from /home/asad/Bookmarker/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:58:in `establish_connection' 
from /home/asad/Bookmarker/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/connection_specification.rb:53:in `establish_connection' 
from ./Bookmarker/script/../config/../vendor/rails/railties/lib/initializer.rb:392:in `initialize_database' 
from ./Bookmarker/script/../config/../vendor/rails/railties/lib/initializer.rb:139:in `process' 
from ./Bookmarker/script/../config/../vendor/rails/railties/lib/initializer.rb:112:in `send' 
from ./Bookmarker/script/../config/../vendor/rails/railties/lib/initializer.rb:112:in `run' 
from /home/asad/Bookmarker/config/environment.rb:13 
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require' 
from /home/asad/Bookmarker/vendor/rails/railties/lib/commands/generate.rb:1 
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' 
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require' 
from ./Bookmarker/script/generate:3 

が出力されますから:

[email protected]:~$ gem env 
RubyGems Environment: 
- RUBYGEMS VERSION: 1.3.5 
- RUBY VERSION: 1.8.7 (2010-01-10 patchlevel 249) [i486-linux] 
- INSTALLATION DIRECTORY: /var/lib/gems/1.8 
- RUBY EXECUTABLE: /usr/bin/ruby1.8 
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin 
- RUBYGEMS PLATFORMS: 
    - ruby 
    - x86-linux 
- GEM PATHS: 
    - /var/lib/gems/1.8 
    - /home/asad/.gem/ruby/1.8 
- GEM CONFIGURATION: 
    - :update_sources => true 
    - :verbose => true 
    - :benchmark => false 
    - :backtrace => false 
    - :bulk_threshold => 1000 
- REMOTE SOURCES: 
    - http://gems.rubyforge.org/ 

私のdatabase.ymlのは

development: 
    adapter:mysql2 
    database:bookmarker 
    host:localhost 
    username:root 
    password:**** 

この上の任意の入力である、であろう大きな助け。ありがとう。

答えて

2

最初にrake db:createを実行してデータベースを初期化する必要があります。

+0

だけでなく、これは、MySQL 開発の前にスペースを追加し、私の問題を修正: アダプタ:mysqlの データベース:しおり ホスト:ルート パスワード:ファイル形式が使用されているため** – user1141584

+0

スペースが必要とされている ユーザ名はlocalhostデータベース設定はYAMLです:https://en.wikipedia.org/wiki/YAML – SciPhi