0
마이그레이션을 사용하여 SQL Server보기를 관리하려고합니다. rails_sql_views 확장 프로그램을 찾았지만 정확하게 필요한 것처럼 보였습니다. 그러나 마이그레이션을 실행할 때 오류가 발생했습니다. 알아낼 수 없습니다. 여기rails_sql_views 오류가 발생 했습니까?
rake aborted!
An error has occurred, this and all later migrations canceled:
uninitialized constant CreateFunds
내 마이그레이션입니다 : 내가 레일 3.1.1를 사용하고 있습니다
class CreateFundView < ActiveRecord::Migration
def up
create_view :v_funds, "SELECT * from funds"
end
def down
drop_view :v_funds
end
end
가 여기에 오류입니다. 누구든지 나를 도울 수 있습니까?
클래스 이름에 "s"를 누락 :
여기https://github.com/mremolt/rails_sql_views.git
가 작동 마이그레이션입니다 : 여기에 노력하고 보석에 대한 링크는? 또는 클래스 이름이 마이그레이션 파일 이름과 일치하지 않습니까? –
모든 것을 확인했습니다. 도움이된다면 여기에 스택 추적이 있습니다. https://gist.github.com/1371954 – SteveO7
정말입니까? 마이그레이션 파일의 이름이'db/migrate/20111117101626_create_funds.rb'이며이 파일의 마이그레이션 클래스 이름은'CreateFundView'이지만 레일스는'CreateFunds' 클래스 이름을 찾을 것으로 예상합니다. 따라서 마이그레이션 파일의 이름을 바꾸거나 클래스 이름을 변경하여 일치 시키십시오. –