参考書を元にrubyの勉強を一人でしております。
参考書通りにコードを記述していき、コンソールを実行してコード入力した際に下記のエラーメッセージが出ました。
yamadataku-no-MacBook-Pro:asagao taku$ bin/rails c
Loading development environment (Rails 4.2.1)
irb(main):001:0> Member.count
ActiveRecord::StatementInvalid: Could not find table 'members'
from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:511:in table_structure' from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/sqlite3_adapter.rb:385:in
columns'
from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/connection_adapters/schema_cache.rb:43:in columns' from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/attributes.rb:93:in
columns'
from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/model_schema.rb:260:in column_names' from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/relation/calculations.rb:226:in
aggregate_column'
from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/relation/calculations.rb:252:in execute_simple_calculation' from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/relation/calculations.rb:221:in
perform_calculation'
from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/relation/calculations.rb:127:in calculate' from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/relation/calculations.rb:42:in
count'
from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activerecord-4.2.1/lib/active_record/querying.rb:13:in count' from (irb):1 from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/console.rb:110:in
start'
from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/console.rb:9:in start' from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:68:in
console'
from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in run_command!' from /Users/taku/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in
<top (required)>'
from bin/rails:4:in require' from bin/rails:4:in
<main>'irb(main):002:0>
引き続き調べているのですが、何か思い当たるところがある方いらっしゃいましたら回答頂けるとありがたいです。
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2016/03/09 13:14