お世話になります。
rubyでerbを使用したコードを実行したのですがエラーになりました。
環境はwindowsです。
- エラー内容
ruby ex2604.erb
ex2604.erb:1: syntax error, unexpected tIDENTIFIER, expecting $end
% # * coding: windows-31j
- ソース
% # coding: windows-31j
% require 'rubygems'
% require 'dbi'
% dbh = DBI.connect('DBI:SQLite3:fruits01.db')
% sth = dbh.execute("select * from products")
% sth.each do |row|
<ul> % row.each_with_name do |val, name| <li><%="#{name}: #{val.to_s}"%></li> % end </ul> % end% sth.finish
% dbh.disconnect
アドバイス宜しくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2015/04/26 14:53