cannot load such file -- ruby-wmi (LoadError) & cannot load such file -- win32/service (LoadError)
The error message cannot load such file -- ruby-wmi (LoadError)
is coming up because chef-client
cannot find the required gems.
This issue is addressed on the Opscode/Chef wiki page on Common Errors.
As mentioned there, install the required gems with the following commands:
C:\> gem install win32-open3 ruby-wmi windows-api windows-pr --no-rdoc --no-ri --verbose
C:\> gem install rdp-ruby-wmi
ruby 1.9.3 can't use open3 (uninitialized constant ConfigureController::Open3)
Did you require 'open3'
at the top of your source file? It's possible that before, it was required in turn by something else you were requiring, but now in 1.9.3 it is not. You may need to explicitly require it.
Problems with jammit gem on windows x64
Add this to your Gemfile:
gem 'win32-open3'
and bundle
trying to run rails_upgrade plugin and getting a fork() error:
I just had the same problem. You need to install the win32-open3
gem (gem install win32-open3
) and then edit this file in your webapp:
vendor\plugins\rails_upgrade\lib\application_checker.rb
and change:
require 'open3'
to:
require 'win32/open3'
Foreman start fails on Windows following Heroku tutorial
Although this question doesn't seem to be of interest to anyone here (5 views in ~2 hours, 0 answers, 0 comments...), I have found the solution and ready to share it with anyone that will encounter it:
Install the latest ruby from rubyinstaller.org (1.9.3-p194) - Sometimes there is a collision installs of the same version, in my case I've just uninstalled all versions of ruby, but if you already have other application that needs older version then you have to be more careful
Check that your system is default to use this version by invoking
ruby -v
in command line prompt: and gettingruby 1.9.3p194 (2012-04-20) [i386-mingw32]
(you may have to close and re-opencmd
, to include the new environment variables)Still in cmd, invoke:
gem install foreman
gem install tapsnow go to your
Procfile
app (e.g. your heroku example app from the tutorial) and executeforeman start
, you should see something like this:18:23:52 web.1 | started with pid 7212
18:23:54 web.1 | * Running on http://0.0.0.0:5000/
18:23:54 web.1 | * Restarting with reloader
cannot load such file -- bundler/setup (LoadError)
It could be that there was a previous Ruby env installed on your system prior to your installation of 2.0? This might have had an existing GEM_PATH that lead to the /1.8 directory which the installation of version 2.0 simply kept.
The problem you where likely having, then, was that Passenger/Apache was looking in the /2.0 directory when in fact the gems were in the /1.8 directory. Your explicitly telling apache to use the /1.8 directory thus makes sense to fix the problem.
SetEnv GEM_HOME /usr/lib/ruby/gems/1.8
You might also try using the Ruby Version Manager to handle multiple Ruby envs.
Some things I found in Google:
- New to Ruby and am having trouble with LOAD_PATH
- http://weblog.rubyonrails.org/2009/9/1/gem-packaging-best-practices/
- http://guides.rubygems.org/faqs/
Related Topics
How to Pass Multi Value Query Params in Swagger
Accessing a Ruby Hash with a Variable as the Key
Gmaps4Rails:Setting Map Width and Height
How to Cancel Evaluating a Required Ruby File? (A.K.A. Top-Level Return)
What Is an Eoferror in Ruby File I/O
Defined' and 'Unless' Not Working as Expected
Why Can't We Override '||' and '&&'
How to Override the System Timezone in Ruby
Expressing Conditional Haml Possibly with Ternary Operator
Validates Presense VS Null False in Rails Models/Tables
How to Escape the Vertical Bar When Doing Command Line with Ruby
How to Speed Up Ruby/Rake Task
Rails Not Working for New Project. Showingerror " Superclass Mismatch for Class Cipher (Typeerror)"