Skip to content

Commit 46acdcf

Browse files
committed
Add support for windows and ruby 2.2.4
1 parent a2dd5b6 commit 46acdcf

File tree

4 files changed

+46
-11
lines changed

4 files changed

+46
-11
lines changed

Gemfile

Lines changed: 9 additions & 4 deletions
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"
@@ -43,7 +42,7 @@ gem "rails-html-sanitizer"
4342
gem "react_on_rails", "~> 5.1.1"
4443

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

4847
gem "autoprefixer-rails"
4948

@@ -56,6 +55,8 @@ gem "awesome_print"
5655
group :development do
5756
# Access an IRB console on exceptions page and /console in development
5857
gem "web-console"
58+
59+
gem 'listen'
5960
end
6061

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

6768
################################################################################
6869
# Manage application processes
69-
gem "foreman"
70+
gem "foreman", platform: :ruby
7071
gem "factory_girl_rails"
7172

7273
################################################################################
@@ -96,7 +97,7 @@ group :test do
9697
gem "coveralls", require: false
9798
gem "capybara"
9899
gem "capybara-screenshot"
99-
gem "capybara-webkit"
100+
gem "capybara-webkit", platform: :ruby
100101
gem "chromedriver-helper", require: ["selenium_chrome"].include?(ENV["DRIVER"])
101102
gem "database_cleaner"
102103
gem "generator_spec"
@@ -106,3 +107,7 @@ group :test do
106107
gem "rspec-retry"
107108
gem "selenium-webdriver", require: !["poltergeist", "poltergeist_errors_ok", "webkit"].include?(ENV["DRIVER"])
108109
end
110+
111+
# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
112+
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
113+
gem 'wdm', '>= 0.1.0' if Gem.win_platform? # for listen

Gemfile.lock

Lines changed: 23 additions & 5 deletions
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)
@@ -130,6 +131,9 @@ GEM
130131
launchy (2.4.3)
131132
addressable (~> 2.3)
132133
libv8 (3.16.14.13)
134+
listen (3.0.6)
135+
rb-fsevent (>= 0.9.3)
136+
rb-inotify (>= 0.9.7)
133137
loofah (2.0.3)
134138
nokogiri (>= 1.5.9)
135139
mail (2.6.4)
@@ -144,9 +148,12 @@ GEM
144148
nio4r (1.2.1)
145149
nokogiri (1.6.7.2)
146150
mini_portile2 (~> 2.0.0.rc2)
151+
nokogiri (1.6.7.2-x86-mingw32)
152+
mini_portile2 (~> 2.0.0.rc2)
147153
parser (2.3.0.7)
148154
ast (~> 2.2)
149155
pg (0.18.4)
156+
pg (0.18.4-x86-mingw32)
150157
poltergeist (1.9.0)
151158
capybara (~> 2.1)
152159
cliver (~> 0.3.1)
@@ -209,6 +216,9 @@ GEM
209216
thor (>= 0.18.1, < 2.0)
210217
rainbow (2.1.0)
211218
rake (10.5.0)
219+
rb-fsevent (0.9.7)
220+
rb-inotify (0.9.7)
221+
ffi (>= 0.5.0)
212222
rdoc (4.2.2)
213223
json (~> 1.4)
214224
react_on_rails (5.1.1)
@@ -292,6 +302,7 @@ GEM
292302
activesupport (>= 4.0)
293303
sprockets (>= 3.0.0)
294304
sqlite3 (1.3.11)
305+
sqlite3 (1.3.11-x86-mingw32)
295306
temple (0.7.6)
296307
term-ansicolor (1.3.2)
297308
tins (~> 1.0)
@@ -305,9 +316,12 @@ GEM
305316
tins (1.6.0)
306317
tzinfo (1.2.2)
307318
thread_safe (~> 0.1)
319+
tzinfo-data (1.2016.3)
320+
tzinfo (>= 1.0.0)
308321
uglifier (3.0.0)
309322
execjs (>= 0.3.0, < 3)
310323
unicode-display_width (1.0.3)
324+
wdm (0.1.1)
311325
web-console (3.1.1)
312326
activemodel (>= 4.2)
313327
debug_inspector
@@ -322,6 +336,7 @@ GEM
322336

323337
PLATFORMS
324338
ruby
339+
x86-mingw32
325340

326341
DEPENDENCIES
327342
autoprefixer-rails
@@ -340,6 +355,7 @@ DEPENDENCIES
340355
generator_spec
341356
jbuilder
342357
launchy
358+
listen
343359
pg
344360
poltergeist
345361
pry
@@ -366,7 +382,9 @@ DEPENDENCIES
366382
spring-commands-rspec
367383
sqlite3
368384
therubyracer
385+
tzinfo-data
369386
uglifier
387+
wdm (>= 0.1.0)
370388
web-console
371389

372390
BUNDLED WITH

README.md

Lines changed: 13 additions & 1 deletion
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 [email protected]: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

Lines changed: 1 addition & 1 deletion
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)