Skip to content

Commit 1373ec4

Browse files
committed
Add support for windows and ruby 2.2.4
1 parent 97544c8 commit 1373ec4

File tree

4 files changed

+38
-12
lines changed

4 files changed

+38
-12
lines changed

Gemfile

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
source "https://rubygems.org"
2-
ruby "2.3.0"
32

43
#
54
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
@@ -44,7 +43,7 @@ gem "rails-html-sanitizer"
4443
gem "react_on_rails", "~> 5.1.1"
4544

4645
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
47-
gem "therubyracer"
46+
gem "therubyracer", platform: :ruby
4847

4948
gem "autoprefixer-rails"
5049

@@ -67,7 +66,7 @@ group :development, :test do
6766

6867
################################################################################
6968
# Manage application processes
70-
gem "foreman"
69+
gem "foreman", platform: :ruby
7170
gem "factory_girl_rails"
7271

7372
################################################################################
@@ -97,7 +96,7 @@ group :test do
9796
gem "coveralls", require: false
9897
gem "capybara"
9998
gem "capybara-screenshot"
100-
gem "capybara-webkit"
99+
gem "capybara-webkit", platform: :ruby
101100
gem "chromedriver-helper", require: ["selenium_chrome"].include?(ENV["DRIVER"])
102101
gem "database_cleaner"
103102
gem "generator_spec"
@@ -107,3 +106,7 @@ group :test do
107106
gem "rspec-retry"
108107
gem "selenium-webdriver", require: !["poltergeist", "poltergeist_errors_ok", "webkit"].include?(ENV["DRIVER"])
109108
end
109+
110+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
111+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
112+
gem 'wdm', '>= 0.1.0' if Gem.win_platform? # for listen

Gemfile.lock

+17-6
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ GEM
6262
bundler-audit (0.5.0)
6363
bundler (~> 1.2)
6464
thor (~> 0.18)
65-
byebug (8.2.3)
65+
byebug (8.2.4)
6666
capybara (2.7.0)
6767
addressable
6868
mime-types (>= 1.16)
@@ -73,7 +73,7 @@ GEM
7373
capybara-screenshot (1.0.12)
7474
capybara (>= 1.0, < 3)
7575
launchy
76-
capybara-webkit (1.10.0)
76+
capybara-webkit (1.10.1)
7777
capybara (>= 2.3.0, < 2.8.0)
7878
json
7979
childprocess (0.5.9)
@@ -104,12 +104,13 @@ GEM
104104
docile (1.1.5)
105105
erubis (2.7.0)
106106
execjs (2.6.0)
107-
factory_girl (4.5.0)
107+
factory_girl (4.7.0)
108108
activesupport (>= 3.0.0)
109-
factory_girl_rails (4.6.0)
110-
factory_girl (~> 4.5.0)
109+
factory_girl_rails (4.7.0)
110+
factory_girl (~> 4.7.0)
111111
railties (>= 3.0.0)
112112
ffi (1.9.10)
113+
ffi (1.9.10-x86-mingw32)
113114
foreman (0.78.0)
114115
thor (~> 0.19.1)
115116
generator_spec (0.9.3)
@@ -147,9 +148,12 @@ GEM
147148
nio4r (1.2.1)
148149
nokogiri (1.6.7.2)
149150
mini_portile2 (~> 2.0.0.rc2)
151+
nokogiri (1.6.7.2-x86-mingw32)
152+
mini_portile2 (~> 2.0.0.rc2)
150153
parser (2.3.0.7)
151154
ast (~> 2.2)
152155
pg (0.18.4)
156+
pg (0.18.4-x86-mingw32)
153157
poltergeist (1.9.0)
154158
capybara (~> 2.1)
155159
cliver (~> 0.3.1)
@@ -287,7 +291,7 @@ GEM
287291
temple (~> 0.7.3)
288292
tilt (>= 1.3.3, < 2.1)
289293
slop (3.6.0)
290-
spring (1.6.4)
294+
spring (1.7.0)
291295
spring-commands-rspec (1.0.4)
292296
spring (>= 0.9.1)
293297
sprockets (3.6.0)
@@ -298,6 +302,7 @@ GEM
298302
activesupport (>= 4.0)
299303
sprockets (>= 3.0.0)
300304
sqlite3 (1.3.11)
305+
sqlite3 (1.3.11-x86-mingw32)
301306
temple (0.7.6)
302307
term-ansicolor (1.3.2)
303308
tins (~> 1.0)
@@ -311,9 +316,12 @@ GEM
311316
tins (1.6.0)
312317
tzinfo (1.2.2)
313318
thread_safe (~> 0.1)
319+
tzinfo-data (1.2016.3)
320+
tzinfo (>= 1.0.0)
314321
uglifier (3.0.0)
315322
execjs (>= 0.3.0, < 3)
316323
unicode-display_width (1.0.3)
324+
wdm (0.1.1)
317325
web-console (3.1.1)
318326
activemodel (>= 4.2)
319327
debug_inspector
@@ -328,6 +336,7 @@ GEM
328336

329337
PLATFORMS
330338
ruby
339+
x86-mingw32
331340

332341
DEPENDENCIES
333342
autoprefixer-rails
@@ -373,7 +382,9 @@ DEPENDENCIES
373382
spring-commands-rspec
374383
sqlite3
375384
therubyracer
385+
tzinfo-data
376386
uglifier
387+
wdm (>= 0.1.0)
377388
web-console
378389

379390
BUNDLED WITH

README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ See package.json and Gemfile for versions
6868
1. Be sure that you have Node installed! We suggest [nvm](https://github.com/creationix/nvm), with node version `v5.0` or above. See this article [Updating and using nvm](http://forum.shakacode.com/t/updating-and-using-nvm/293).
6969
1. `git clone git@github.com:shakacode/react-webpack-rails-tutorial.git`
7070
1. `cd react-webpack-rails-tutorial`
71-
1. Check that you have Ruby 2.3.0 or greater
71+
1. Check that you have Ruby 2.2.4 or greater
7272
1. Check that you're using the right version of node. Run `nvm list` to check. Use 5.5 or greater.
7373
1. Check that you have Postgres installed. Run `which postgres` to check. Use 9.4 or greater.
7474
1. Check that you have `qmake` installed. Run `which qmake` to check. If missing, follow these instructions: [Installing Qt and compiling capybara-webkit](https://github.com/thoughtbot/capybara-webkit/wiki/Installing-Qt-and-compiling-capybara-webkit)
@@ -86,6 +86,18 @@ See package.json and Gemfile for versions
8686
1. Open a browser tab to http://localhost:3000 for the Rails app example.
8787
2. When you make changes, you have to refresh the browser page.
8888

89+
# Notes running in Windows
90+
91+
Due to foreman not support windows, running below command in 4 different cmd prompt.
92+
93+
```bat
94+
npm run hot-assets
95+
npm run build:dev:client
96+
npm run build:dev:server
97+
set REACT_ON_RAILS_ENV=HOT
98+
rails s -b 0.0.0.0
99+
```
100+
89101
## Hot Reloading Example: applies to both `Procfile.hot` and `Procfile.express`
90102
1. With the browser open to any JSX file, such as [client/app/bundles/comments/components/CommentBox/CommentBox.jsx](client/app/bundles/comments/components/CommentBox/CommentBox.jsx) and you can change the JSX code, hit save, and you will see the screen update without refreshing the window. This applies to port 3000 and port 4000.
91103
1. Try changing a `.scss` file, such as a color in [client/app/bundles/comments/components/CommentBox/CommentList/Comment/Comment.scss](client/app/bundles/comments/components/CommentBox/CommentList/Comment/Comment.scss). You can see port 3000 or 4000 update automatically.

config/puma.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# Workers do not work on JRuby or Windows (both of which do not support
2222
# processes).
2323
#
24-
workers ENV.fetch("WEB_CONCURRENCY") { 2 }
24+
workers ENV.fetch("WEB_CONCURRENCY") { 2 } unless Gem.win_platform?
2525

2626
# Use the `preload_app!` method when specifying a `workers` number.
2727
# This directive tells Puma to first boot the application and load code

0 commit comments

Comments
 (0)