Pistolfly のすべての投稿

Software Engineer in Tokyo, Japan

script/consoleでno such file to load -- readline (LoadError)

railsのscript consoleでno such file to load -- readlineと怒られた - tetu1984の日記
CentOSにソースからインストールしたruby環境のrailsのscript/consoleで以下のエラーが発生。

$ ./script/console production
Loading production environment (Rails 2.3.10)
/usr/local/lib/ruby/1.8/irb/completion.rb:10:in `require': no such file to load -- readline (LoadError)
	from /usr/local/lib/ruby/1.8/irb/completion.rb:10
	from /usr/local/lib/ruby/1.8/irb/init.rb:254:in `require'
	from /usr/local/lib/ruby/1.8/irb/init.rb:254:in `load_modules'
	from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `each'
	from /usr/local/lib/ruby/1.8/irb/init.rb:252:in `load_modules'
	from /usr/local/lib/ruby/1.8/irb/init.rb:21:in `setup'
	from /usr/local/lib/ruby/1.8/irb.rb:54:in `start'
	from /usr/local/bin/irb:13

対処方法
readline-develをインストールしてからmakeしなおす。

$ sudo yum install readline-devel
$ cd ~/src/ruby-1.8.7-p302/ext/readline/
$ ruby extconf.rb 
$ make
$ sudo make install

Failed to load class org.slf4j.impl.StaticLoggerBinder

SLF4J Error Codes

This error is reported when the org.slf4j.impl.StaticLoggerBinder class could not be loaded into memory. This happens when no appropriate SLF4J binding could be found on the class path. Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.
As of SLF4J version 1.6, in the absence of a binding, SLF4J will default to a no-operation (NOP) logger implementation.

、、、ということなので、とりあえずpom.xmlに

<dependency>
	<groupId>org.slf4j</groupId>
	<artifactId>slf4j-api</artifactId>
	<version>1.6.1</version>
</dependency>

TomcatのGETリクエストで文字化け

Tomcatのserver.xmlのConnector要素に以下の属性を設定する。
URIEncoding --- URIをデコードするときの文字エンコーディング。デフォルトはISO-8859-1。
useBodyEncodingForURI --- URIパラメータのデコードにサブミットしたフォームのページの文字エンコーディングを使用するかどうか。デフォルトはfalse。
(Apache Tomcat Configuration Reference - The HTTP Connector)
例:

<Connector port="8080" protocol="HTTP/1.1" 
       connectionTimeout="20000" 
       redirectPort="8443"
       URIEncoding="UTF-8" useBodyEncodingForURI="true" />

Tomcat5/6のGETリクエストで文字化け - @"かたち開発の開発日記"
Encoding problem for czech characters in HttpRequest parameters - Spring Community Forums