Written February 10, 2010 in Programming

UPDATE: This can be resolved by following the tutorial here.

I recently began following the tutorial Rolling with Ruby on Rails on a Windows 7 x64 machine and ran into the following error when attempting to run ‘ruby script\server’:


C:/dev/apps/ruby-1.9.1-p376/lib/ruby/gems/1.9.1/gems/rails-2.3.5/lib/initializer
.rb:271:in `rescue in require_frameworks': 193: %1 is not a valid Win32 applicat
ion. - C:/dev/apps/ruby-1.9.1-p376/lib/ruby/1.9.1/i386-mswin32/openssl.so (Run
timeError)
from C:/dev/apps/ruby-1.9.1-p376/lib/ruby/gems/1.9.1/gems/rails-2.3.5/li
b/initializer.rb:268:in `require_frameworks'
from C:/dev/apps/ruby-1.9.1-p376/lib/ruby/gems/1.9.1/gems/rails-2.3.5/li
b/initializer.rb:134:in `process'
from C:/dev/apps/ruby-1.9.1-p376/lib/ruby/gems/1.9.1/gems/rails-2.3.5/li
b/initializer.rb:113:in `run'
from C:/Dev/rails/cookbook/config/environment.rb:9:in `

from C:/dev/apps/ruby-1.9.1-p376/lib/ruby/gems/1.9.1/gems/activesupport-
2.3.5/lib/active_support/dependencies.rb:156:in `require’
from C:/dev/apps/ruby-1.9.1-p376/lib/ruby/gems/1.9.1/gems/activesupport-
2.3.5/lib/active_support/dependencies.rb:156:in `block in require’
from C:/dev/apps/ruby-1.9.1-p376/lib/ruby/gems/1.9.1/gems/activesupport-
2.3.5/lib/active_support/dependencies.rb:521:in `new_constants_in’
from C:/dev/apps/ruby-1.9.1-p376/lib/ruby/gems/1.9.1/gems/activesupport-
2.3.5/lib/active_support/dependencies.rb:156:in `require’
from C:/dev/apps/ruby-1.9.1-p376/lib/ruby/gems/1.9.1/gems/rails-2.3.5/li
b/commands/server.rb:84:in `
from script/server:3:in `require’
from script/server:3:in `


I haven’t figured out a fix to the issue but I am assuming it has something to do with the version of the openssl.so. Here is the workaround to at least get it so you can get working:

  1. Navigate to the folder %RUBY_HOME%\lib\ruby\1.9.1
  2. Make a backup copy of the file openssl.rb
  3. Edit the openssl.rb file and put a # in front of every line that starts with ‘require’. Example: require ‘openssl.so’ becomes #require ‘openssl.so’
  4. Save the file and attempt to run ruby script\server again and it should work properly.

After saving the openssl.rb file with the changes and running ‘ruby script\server’ you should now be presented with something similar to the following:


=> Booting WEBrick
=> Rails 2.3.5 application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2010-02-10 21:40:01] INFO WEBrick 1.3.1
[2010-02-10 21:40:01] INFO ruby 1.9.1 (2009-12-07) [i386-mswin32]
[2010-02-10 21:40:01] INFO WEBrick::HTTPServer#start: pid=3020 port=3000

You can access the app by visiting http://localhost:3000/ in your browser. If I find a solution I will post a new article detailing it.

No comments on ' Ruby 1.9.1 Cannot Start Server - openssl.so Win7 x64 Workaround '

  1. No comments yet.

Leave a comment