Skip to content

Instantly share code, notes, and snippets.

@sanemat
Created February 19, 2012 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sanemat/1864739 to your computer and use it in GitHub Desktop.
Save sanemat/1864739 to your computer and use it in GitHub Desktop.
lazyLines does not work
ghc --make -W -fno-warn-unused-matches -cpp -DPOSIX CGIMain.hs -o index.cgi
[ 1 of 14] Compiling LineParser ( LineParser.hs, LineParser.o )
[ 2 of 14] Compiling PathUtils ( PathUtils.hs, PathUtils.o )
[ 3 of 14] Compiling FileUtils ( FileUtils.hs, FileUtils.o )
FileUtils.hs:16:1:
Warning: The import of `System.IO' is redundant
except perhaps to import instances from `System.IO'
To import instances alone, use: import System.IO()
[ 4 of 14] Compiling TextUtils ( TextUtils.hs, TextUtils.o )
[ 5 of 14] Compiling URLEncoding ( URLEncoding.hs, URLEncoding.o )
[ 6 of 14] Compiling HTML ( HTML.hs, HTML.o )
[ 7 of 14] Compiling Syntax ( Syntax.hs, Syntax.o )
[ 8 of 14] Compiling Config ( Config.hs, Config.o )
[ 9 of 14] Compiling Database ( Database.hs, Database.o )
Database.hs:21:1:
Warning: The import of `Data.List' is redundant
except perhaps to import instances from `Data.List'
To import instances alone, use: import Data.List()
[10 of 14] Compiling Template ( Template.hs, Template.o )
[11 of 14] Compiling URLMapper ( URLMapper.hs, URLMapper.o )
URLMapper.hs:16:1:
Warning: The import of `Data.List' is redundant
except perhaps to import instances from `Data.List'
To import instances alone, use: import Data.List()
[12 of 14] Compiling CGI ( CGI.hs, CGI.o )
CGI.hs:19:1:
Warning: The import of `Control.Monad' is redundant
except perhaps to import instances from `Control.Monad'
To import instances alone, use: import Control.Monad()
CGI.hs:69:18:
Warning: Pattern match(es) are non-exhaustive
In a case alternative:
Patterns not matched:
(_, (GHC.Types.C# #x) : _) with #x `notElem` ['=']
[13 of 14] Compiling LazyLines ( LazyLines.hs, LazyLines.o )
LazyLines.hs:23:1:
Warning: The import of `Data.Maybe' is redundant
except perhaps to import instances from `Data.Maybe'
To import instances alone, use: import Data.Maybe()
LazyLines.hs:41:34: Warning: Defined but not used: `name'
LazyLines.hs:43:50: Warning: Defined but not used: `content'
[14 of 14] Compiling Main ( CGIMain.hs, CGIMain.o )
Linking index.cgi ...
ld: warning: could not create compact unwind for .LFB3: non-standard register 5 being saved in prolog
ghc --make -W -fno-warn-unused-matches -cpp -DPOSIX compile.hs -o compile
[5 of 5] Compiling Main ( compile.hs, compile.o )
Linking compile ...
ld: warning: could not create compact unwind for .LFB3: non-standard register 5 being saved in prolog
ghc --make -W -fno-warn-unused-matches -cpp -DPOSIX showconfig.hs -o showconfig
[3 of 3] Compiling Main ( showconfig.hs, showconfig.o )
Linking showconfig ...
ld: warning: could not create compact unwind for .LFB3: non-standard register 5 being saved in prolog
diff --git a/cgirunner.rb b/cgirunner.rb
index 2d530a9..6fca618 100755
--- a/cgirunner.rb
+++ b/cgirunner.rb
@@ -7,7 +7,7 @@
# reserved.
#
# $IPR: cgi_runner.rb,v 1.9 2002/09/25 11:33:15 gotoyuzo Exp $
-
+$:.unshift File.dirname(__FILE__)
def sysread(io, size)
buf = ""
while size > 0
diff --git a/server.rb b/server.rb
index 5327f86..400c6dd 100755
--- a/server.rb
+++ b/server.rb
@@ -1,4 +1,5 @@
# -*- coding: euc-jp -*-
+$:.unshift File.dirname(__FILE__)
require 'webrick'
require 'optparse'
$ ruby server.rb
*****************************************************
Type Ctrl-C to stop server
*****************************************************
[2012-02-20 02:28:21] INFO WEBrick 1.3.1
[2012-02-20 02:28:21] INFO ruby 1.9.3 (2012-02-16) [x86_64-darwin10.8.0]
[2012-02-20 02:28:21] DEBUG TCPServer.new(127.0.0.1, 10081)
[2012-02-20 02:28:21] DEBUG WEBrick::HTTPServlet::FileHandler is mounted on /.
[2012-02-20 02:28:21] INFO WEBrick::HTTPServer#start: pid=6993 port=10081
[2012-02-20 02:28:31] DEBUG accept: 127.0.0.1:60915
[2012-02-20 02:28:31] DEBUG accept: 127.0.0.1:60916
[2012-02-20 02:28:32] DEBUG WEBrick::HTTPServlet::FileHandler is invoked.
[2012-02-20 02:28:32] ERROR CGIHandler: /Users/sane/work/ghc-study/lazylines/index.cgi:
index.cgi: var/pages/FrontPage: hGetContents: invalid argument (Illegal byte sequence)
[2012-02-20 02:28:32] ERROR CGIHandler: /Users/sane/work/ghc-study/lazylines/index.cgi exit with 1
[2012-02-20 02:28:32] ERROR Premature end of script headers: /Users/sane/work/ghc-study/lazylines/index.cgi
localhost - - [20/Feb/2012:02:28:32 JST] "GET / HTTP/1.1" 500 360
[2012-02-20 02:28:32] DEBUG close: 127.0.0.1:60915
[2012-02-20 02:28:32] DEBUG WEBrick::HTTPServlet::FileHandler is invoked.
[2012-02-20 02:28:32] ERROR `/favicon.ico' not found.
localhost - - [20/Feb/2012:02:28:32 JST] "GET /favicon.ico HTTP/1.1" 404 282
[2012-02-20 02:28:32] DEBUG close: 127.0.0.1:60916
$ rvm list
rvm rubies
macruby-0.10 [ x86_64 ]
=> ruby-1.8.7-p334 [ i686 ]
ruby-1.9.2-p180 [ x86_64 ]
ruby-1.9.2-p290 [ x86_64 ]
ruby-1.9.3-p0 [ x86_64 ]
* ruby-1.9.3-p125 [ x86_64 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment