0
gem을 설치하는 코드가 포함 된 shoes.rb 파일을 실행할 때 오류가 발생합니다. 신발에 대한신발 설정 관련 문제
정의되지 않은 방법 설정 : 클래스
코드 : 문제는 설정 방법이 구현되지 않은했다 Shoes4을 사용했다
Shoes.setup do
gem 'activerecord' # install AR if not found
require 'active_record'
require 'fileutils'
ActiveRecord::Base.establish_connection(
:adapter => 'postgresql',
:dbfile => 'shoes_app'
)
# create the db if not found
unless File.exist?("shoes_app.sqlite3")
ActiveRecord::Schema.define do
create_table :notes do |t|
t.column :message, :string
end
end
end
end
class ShoesApp < Shoes
require 'note'
url '/', :index
def index
para 'Say something...'
flow do
@note = edit_line
button 'OK' do
Note.new(:message => @note.text).save
@note.text = ''
@result.replace get_notes
end
end
@result = para get_notes
end
def get_notes
messages = []
notes = Note.find(:all, :select => 'message')
notes.each do |foo|
messages << foo.message
end
out = messages.join("n")
end
end
Shoes.app :title => 'Notes', :width => 260, :height => 350
이 문제는 우분투에서 apt-get install shoes 명령을 사용하여 신발을 설치했기 때문에 발생합니다. 오래된 신발을 설치합니다. 그래서 Shoes4를 설치했습니다. https://github.com/shoes/shoes/issues/243#issuecomment-20177923 –