Unfortunately with the recent releases of Rails 5 and Windows 10, and with RailsInstaller falling behind on updates, we need to take a few steps to fix some annoying incompatibilities once and for all.
First of all, the very first time you bundle
for an app, remember to use the verbose command bundle install --without production
instead.
If you are experiencing one of the following issues:
-
When you try to
bundle
, you receive an error that looks something likeSSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
Or you might get a message about "man in the middle" attacks.
-
When you try to access an API URL that begins with "https" (rather than "http"), it fails.
then you are most likely missing SSL certificates on your machine.
Described here. You need to download a file called cacert.pem
into your C:\RailsInstaller
folder, and then create a system environment variable through the Control Panel.
You should then be all set -- bundle
and https API calls should work just fine.
If you see an error message about ExecJS (TypeError: Object doesn't support this property or method
), or if the server takes forever to respond to a page request, then you need to install Node.js. Download the .msi
file, double-click it, and accept the defaults for the prompts.
After installation completes, restart your computer and try again. All should be well.
Add gem "wdm" if Gem.win_platform?
anywhere in the Gemfile and bundle
to get rid of the WDM warnings.
-
For the
bundle
issue, in your Gemfile, replacesource 'https://rubygems.org'
withsource 'http://rubygems.org'
(remove thes
). -
For the API issue, add a file in
config/initializers
calleddisable_ssl.rb
with the following contents:require 'openssl' OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
and then restart your server.
- Add
gem "coffee-script-source", "1.8.0"
anywhere in the file - Then
bundle update
If that still doesn't work, try the following in succession:
- In
app/assets/javascripts/application.js
, delete the line//= require_tree .
- In the Gemfile, uncomment
gem "therubyracer", platforms: :ruby
and thenbundle
.
Restart your server, and hopefully now you will be able to load a page successfully.
Some combination of the above steps have resolved the issues for everyone I have tested with. However, if you still are seeing the ExecJS issue, try the following:
-
In
app/views/layouts/application.html.erb
, change lines 18 & 19 from<%= stylesheet_link_tag "application", :media => "all" %> <%= javascript_include_tag "application" %>
to
<%#= stylesheet_link_tag "application", :media => "all" %> <%#= javascript_include_tag "application" %>
(Insert a
#
between the%
and=
.)This is a short-term solution; I am working on something more permanent. In the meantime, be aware that these changes will break the Sign Out link, so you will have to clear cookies for localhost:3000 to sign out. Also, it will break the "Show Filters" button.