WEBrickを立ち上げようとしたらエラーが出た。
shell
$ bin/rails s
bin/rails:6: warning: already initialized constant APP_PATH
bin/rails:6: warning: previous definition of APP_PATH was here
Usage: rails COMMAND [ARGS]
The most common rails commands are:
generate Generate new code (short-cut alias: "g")
console Start the Rails console (short-cut alias: "c")
server Start the Rails server (short-cut alias: "s")
dbconsole Start a console for the database specified in config/database.yml
(short-cut alias: "db")
new Create a new Rails application. "rails new my_app" creates a
new application called MyApp in "./my_app"
In addition to those, there are:
application Generate the Rails application code
destroy Undo code generated with "generate" (short-cut alias: "d")
plugin new Generates skeleton for developing a Rails plugin
runner Run a piece of code in the application environment (short-cut alias: "r")
All commands can be run with -h (or --help) for more information.
このエラーメッセージだけでは検討つかなかったが、
MySQLのlibmysqlclient
が読み込めていなかったのが原因だった。
以下のコマンドでシンボリックリンクを貼ったら、
正常にサーバが起動するようになった。
shell
sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
参考
rails server bin/rails:6: warning: already initialized constant APP_PATH error
http://stackoverflow.com/questions/23402820/rails-server-bin-rails6-warning-already-initialized-constant-app-path-error