LoginSignup
4

More than 5 years have passed since last update.

OttoでRailsの開発環境を構築した時に、Webrickのレスポンスが遅い時の対応方法

Last updated at Posted at 2016-01-28

方法1: Vagrantの設定を変更する

(TODO: dev_vagrantfileを使ったほうがよさそう。 参考サイト)

synced_folderのnfsを有効にし、メモリサイズを4Gにします。

# ottoのVagrantファイルを開きます
$ vim .otto/compiled/app/dev/Vagrantfile

# 以下の部分を修正します
-----
  # nfsを有効にします
  ## Setup a synced folder from our working directory to /vagrant
  #config.vm.synced_folder '/Users/kyamada/git/hoge', "/vagrant",
  #  owner: "vagrant", group: "vagrant"
  config.vm.synced_folder '/Users/kyamada/git/hoge', "/vagrant",
    nfs: true

  # メモリを4Gにします
  config.vm.provider "virtualbox" do |vb|
    vb.memory = "4096"
  end
-----

# Vagrantを再起動します
$ otto dev vagrant reload

方法2: Webrickの設定で:DoNotReverseLookupをtrueにする

$ otto dev ssh
$ gem which webrick
/opt/rubies/ruby-2.2.4/lib/ruby/2.2.0/webrick.rb
$ vim /opt/rubies/ruby-2.2.4/lib/ruby/2.2.0/webrick/config.rb 

----
#:DoNotReverseLookup => nil
:DoNotReverseLookup => true
----

参考

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4