From 98bf443d82de365e9b3b7ef7db934085a4f55e55 Mon Sep 17 00:00:00 2001 From: Elliot Murphy Date: Thu, 7 Feb 2013 00:41:27 -0500 Subject: [PATCH 1/5] Fix guard warning with version spec for rb-notify. --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index fe84fb1f10c..e438c2405fc 100644 --- a/Gemfile +++ b/Gemfile @@ -102,7 +102,7 @@ group :test, :development do gem 'image_optim' gem 'certified' gem 'rb-fsevent' - gem 'rb-inotify', :require => RUBY_PLATFORM.include?('linux') && 'rb-inotify' + gem 'rb-inotify', '~> 0.8.8', :require => RUBY_PLATFORM.include?('linux') && 'rb-inotify' gem 'terminal-notifier-guard', :require => RUBY_PLATFORM.include?('darwin') && 'terminal-notifier-guard' end diff --git a/Gemfile.lock b/Gemfile.lock index 15a5bbebb93..85225874b69 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -256,7 +256,7 @@ GEM thor (>= 0.14.6, < 2.0) rake (10.0.3) rb-fsevent (0.9.3) - rb-inotify (0.9.0) + rb-inotify (0.8.8) ffi (>= 0.5.0) rdoc (3.12) json (~> 1.4) @@ -416,7 +416,7 @@ DEPENDENCIES rails_multisite! rake rb-fsevent - rb-inotify + rb-inotify (~> 0.8.8) redis redis-rails rest-client From bfa7a5fd678cbc7382a4b034f291dbfcc8642869 Mon Sep 17 00:00:00 2001 From: Elliot Murphy Date: Thu, 7 Feb 2013 00:42:47 -0500 Subject: [PATCH 2/5] Increase timeout for spork startup. --- Guardfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Guardfile b/Guardfile index 0fcebb98d8a..63fc2c0c5a4 100644 --- a/Guardfile +++ b/Guardfile @@ -1,4 +1,4 @@ -guard 'spork' do +guard :spork, wait: 120 do watch('config/application.rb') watch('config/environment.rb') watch(%r{^config/environments/.*\.rb$}) From 43d4eb681e0c073160e1145034226066083ac8b6 Mon Sep 17 00:00:00 2001 From: Elliot Murphy Date: Thu, 7 Feb 2013 01:10:46 -0500 Subject: [PATCH 3/5] Fix Guardfile warning about deprecated :version arg. --- Guardfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Guardfile b/Guardfile index 63fc2c0c5a4..6dca485a9d6 100644 --- a/Guardfile +++ b/Guardfile @@ -27,7 +27,7 @@ guard 'jasmine', jasmine_options do watch(%r{spec/javascripts/spec\.(js\.coffee| watch(%r{app/assets/javascripts/(.+?)\.(js\.coffee|js|coffee)$}) { "spec/javascripts" } end -guard 'rspec', :focus_on_failed => true, :version => 2, :cli => "--drb" do +guard 'rspec', :focus_on_failed => true, :cli => "--drb" do watch(%r{^spec/.+_spec\.rb$}) #watch(%r{^lib/jobs/(.+)\.rb$}) { |m| "spec/components/jobs/#{m[1]}_spec.rb" } watch(%r{^lib/(.+)\.rb$}) { |m| "spec/components/#{m[1]}_spec.rb" } From f54e530a3ebb5ffa60c0fb620e35b206fb7d99ea Mon Sep 17 00:00:00 2001 From: Elliot Murphy Date: Thu, 7 Feb 2013 01:13:24 -0500 Subject: [PATCH 4/5] Tuneups of Vagrant Increase memory allocation to 512MB so guest VM is not swapping. SSH forwarding, DNS host nat resolver. Don't use NFS on darwin, just use standard folder sharing. --- Vagrantfile | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index f974697d1be..c723a86a320 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -1,14 +1,29 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : # See https://github.com/discourse/core/blob/master/DEVELOPMENT.md # Vagrant::Config.run do |config| config.vm.box = 'discourse-pre' config.vm.box_url = 'http://www.discourse.org/vms/discourse-pre.box' + + # Make this VM reachable on the host network as well, so that other + # VM's running other browsers can access our dev server. config.vm.network :hostonly, '192.168.10.200' + # Make it so that network access from the vagrant guest is able to + # use SSH private keys that are present on the host without copying + # them into the VM. + config.ssh.forward_agent = true + + # This setting gives the VM 512MB of MEMORIES instead of the default 384. + config.vm.customize ["modifyvm", :id, "--memory", 512] + + # This setting makes it so that network access from inside the vagrant guest + # is able to resolve DNS using the hosts VPN connection. + config.vm.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] + config.vm.forward_port 3000, 4000 config.vm.forward_port 1080, 4080 # Mailcatcher - if RUBY_PLATFORM =~ /darwin/ - config.vm.share_folder("v-root", "/vagrant", ".", :nfs => true) - end + config.vm.share_folder("v-root", "/vagrant", ".") end From 3b49f96e9abc5d70dd721a5c84e7d55baf80e478 Mon Sep 17 00:00:00 2001 From: Elliot Murphy Date: Thu, 7 Feb 2013 01:18:45 -0500 Subject: [PATCH 5/5] Update & simplify vagrant instructions. The gem installer is deprecated, direct people to the real installer. No longer need to require XCode and RVM installs, just install vagrant and go. Password prompt during boot only happens on windows, not OS X and Linux hosts. --- DEVELOPMENT.md | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index aff60de62c4..95c7d384c86 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -7,13 +7,11 @@ on Discourse with: ### Getting Started -1. Install the Xcode tools: https://developer.apple.com/xcode/ -2. Install VirtualBox: https://www.virtualbox.org/wiki/Downloads -3. Install Ruby 1.9.3. We recommend RVM: https://rvm.io/ -4. Open a terminal -5. Clone the project: `git@github.com:discourse/discourse.git` -6. Enter the project directory: `cd discourse` -7. Install vagrant: `gem install vagrant` +1. Install VirtualBox: https://www.virtualbox.org/wiki/Downloads +2. Install Vagrant: https://www.vagrantup.com/ +3. Open a terminal +4. Clone the project: `git@github.com:discourse/discourse.git` +5. Enter the project directory: `cd discourse` ### Using Vagrant @@ -22,7 +20,7 @@ When you're ready to start working, boot the VM: vagrant up ``` -It should prompt you for your admin password. This is so it can mount your local files inside the VM for an easy workflow. +On Windows, it will prompt you for your admin password. This is so it can mount your local files inside the VM for an easy workflow. (The first time you do this, it will take a while as it downloads the VM image and installs it. Go grab a coffee.)