require 'gemname' in IRB, and
got some confusing results - mostly [], ["gemname"], or 'no such file to
load'. How do I determine that a gem is or is not working?--platform=mingw32 because I think that's
what I've got, but the devkit wiki page [2] seems to say that I should
use --platform=ruby regardless of the platform I'm on:
"It’s crucial that you include the --platform=ruby option
to
force RubyGems to build the native gem rather than potentially
installing an incorrect binary gem."Yes.
> I'm using ruby 1.9.1p378 (2010-01-10 revision 26273) [i386-mingw32] with pik
> (I also have 1.8.7 installed), and have the same versions of gems installed
> as a colleague who is not having the problems I am. My specs run fine.
If possible, I would suggest moving from 1.9.1p378 to 1.9.2p0 if only just due to the note http://guides.rubyonrails.org/getting_started.html
> - How do I tell which gems are causing problems? I've tried running require
> 'gemname' in IRB, and got some confusing results - mostly [], ["gemname"],
> or 'no such file to load'. How do I determine that a gem is or is not
> working?
"gem list" can help you spot binary gems that contain "mswin" which may indicate a 1.8 mswin binary gem got pulled in. This won't catch all the cases for you. I usually double check a gem's .so shared lib via something like http://www.dependencywalker.com/ to verify it's linked against 1.9 rather than 1.8. It's a bit more time consuming, but you'll know for sure.
Reply with the output of both "gem env" and "gem list" from your 1.9.1 system and maybe we can quickly help you narrow the list down :)
> - What do the different platforms mean? I kind of assumed that I should be
> using --platform=mingw32 because I think that's what I've got, but the
> devkit wiki page [2] seems to say that I should use
> --platform=rubyregardless of the platform I'm on: "It’s crucial that
> you include the
> --platform=ruby option to force RubyGems to build the native gem rather than
> potentially installing an incorrect binary gem."
When you do something like "gem install rdiscount --platform=ruby" *and* have the DevKit installed, this basically causes the Ruby and RubyGem internals to build the gem from source using the DevKit rather than trying to install a binary gem that RubyGems "thinks" is compatible with your system. RubyGems can pull in 1.8 binaries for 1.9.x systems and I suspect this is what happened in your case as the "bad" gems didn't have "fat" 1.8/1.9 binary gems (e.g. - Nokogiri) available.
Jon
Hello Kira,
Once you receive the popup telling you the missing gem, either on the
Rails log file or the console will display a line telling you failed
to require "xxx" file (LoadError)
Please locate that line which will provide us information on which gem
failed to require.
Also, from your list of gems, look at the ones that tells you a
precise platform has been installed (x86-mingw32) which indicates a
binary gem was installed.
From the top of my head from your gem list I can tell you JSON is not
fat-binary compatible and you need to uninstall it and install from
source
gem install json --platform=ruby
(Having the DevKit installed)
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
This is the first one that jumps out as a problem. If it's the binary gem I think it is, it's 'parser.so' and 'generator.so' (in the gems lib\json\ext dir) links with msvcrt-ruby18.dll and is definitely a source of problems when running 1.9.2-p0.
To fix, you need to uninstall it and reinstall json and build the gem from source using the DevKit [1] and "gem install json --platform=ruby"
There may be others, but double check that json is correct first.
FWIW, while I believe the 'mysql' gem supports both 1.8/1.9, Yehuda had a blog [2] in which he talked about 'mysql2' and Rails3 from a threading perspective. As I don't use MySQL I don't know if your 'mysql' gem is the right one to use, but definitely double check. Search this list for previous discussions as Luis is *very* much involved with MySQL and Ruby on Windows...you may want to search his blog [3] as well.
Jon
[1] http://github.com/oneclick/rubyinstaller/wiki/Development-Kit
[2] http://yehudakatz.com/2010/08/14/threads-in-ruby-enough-already/
[3] http://blog.mmediasys.com/