0
레일 3.2.3irb를 사용하여 데이터베이스 채우기
가장 쉬운 방법으로 데이터베이스를 채울 필요가 있습니다. 그래서 나는
NameError: uninitialized constant MyModelName
from (irb):4
from /home/alex/.rvm/rubies/ruby-1.9.3-p194/bin/irb:16:in `<main>'
가 어떻게 그것을 해결합니까 오류가 IRB
mm = MyModelName.create :title =>'title1', :another_title=>'fdfds', :description =>'desc1 fdsfds'
을 사용하여 데이터베이스를 일부 데이터를 채우기 위해 노력하지만 여기에있어 이제 모델
rails g model MyModelName title:string, another_title:string, description:text
을 생성 ?
데이터베이스 및 내부 레일 콘솔을 마이그레이션하십시오. 'reload!'명령을 실행하십시오. – taro
레일즈 콘솔이란 무엇입니까? 나는'irb '를 사용하고있다. – Alexandre
대신'irb'를 사용하고, 앱의 루트로 가서'rails c'를 실행하십시오. –