Sinatra/Railsがデフォルトでは外部から繋がらない

Rails
Rails4.2からブラウザからアクセスしようとしたら繋がらない。
$ ./bin/rails s
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000

起動時のアドレスがlocalhostになっていると外部からのアクセスが繋がらないのでip指定して起動
$ ./bin/rails s -b 0.0.0.0
($ bundle exec rails s --bind=0.0.0.0)
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://0.0.0.0:3000

netstat -an で Local Address を調べるとよい。
$指定なし
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:3000 0.0.0.0:* LISTEN

$--bind=0.0.0.0
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:3000 0.0.0.0:* LISTEN

                                                                                                                                                                            • -

Sinatraも1.4.2より同様の事態
$ bundle exec ruby hoge.rb

== Sinatra/1.4.2 has taken the stage on 4567 for development with backup from WEBrick
[2015-09-17 23:58:37] INFO WEBrick::HTTPServer#start: pid=10077 port=4567

$ netstat -an
tcp 0 0 127.0.0.1:4567 0.0.0.0:* LISTEN

対応方法
1.実行オプションを使う
$ bundle exec ruby hoge.rb -o 0.0.0.0

2.rubyのコードの中で設定する
set :bind, '0.0.0.0'

3.environment を変える
ローカルからしか繋がらないのは 'development' の時だけなので、environmentに、'production' や 'test' を設定した時は何もしなくても外部から繋がります。

4.実行オプションを使う
$ bundle exec ruby hoge.rb -e production

5.rubyのコードの中で設定する
set :environment, :production