0

I'm running windows 7 64-bit, and have installed ruby via the rubyinstaller located at rubyinstaller.org I am trying to

require 'anygemfile'

And am getting

/dir/dir/file:#::in `require': cannot load such file -- anygemfiles (LoadError).

I can load interactive ruby and require 'redis' => true. Yet require 'redis' returns the above error (s/anygemfiles/redis). The same for sprocket, pry. Any gem file.

ruby -v               => 1.9.3
gem -v                => 1.8.16
which redis           => C:\correct\directory
gem install anygem    => installs gem

The exact code I'm running works out of the box on linux, as well as other windows boxes.

After reinstalling ruby via the rubyinstaller I am now getting:

C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find redis (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
from C:/Users/Tom/workspace/ricrb/asdf.rb:1:in `<main>'
Sturm
  • 4,105
  • 3
  • 24
  • 39
  • Try `require 'rubygems' `,`require 'anygemfile'` – Shamith c Jul 19 '12 at 08:33
  • Have you installed `redis` gem? `gem install redis` and `gem list redis` should display it. If not, you need to install it. – Luis Lavena Jul 19 '12 at 15:58
  • @LuisLavena As I said in the question, which redis shows me the correct directory. That means it can find redis, which means redis is installed. Also, check my answer below, it was a path issue. – Sturm Jul 19 '12 at 17:32
  • @NathanMann one thing is `redis` the program and the other thing is redis the gem. Ruby is complaining about not finding the gem `redis`, which is the client library to connect to `redis` the service (which, btw, you need to have running) – Luis Lavena Jul 20 '12 at 00:48
  • @LuisLavena I wasn't having connect problems, specifically gem problems. I'm aware that redis-server and the redis gem are two particularly different beasts. – Sturm Jul 20 '12 at 17:34
  • @NathanMann the error you described in your questions clearly indicates the **gem** `redis` is missing. Either because is not installed (which you can check with `gem list redis`) or verify your Gemfile if you're using Bundler. So my suggestion was to tell you install the gem redis... So I clearly answered your question from what you provided, nowhere above you mentioned it couldn't connect or an actual redis connection issue... Or I'm missing something? – Luis Lavena Jul 22 '12 at 00:47
  • @LuisLavena lol yes, my answer below. My problem was an incorrect path. – Sturm Jul 22 '12 at 04:34

2 Answers2

2

I also solved my problem.

Initially I installed ruby1.9.3. After that I installed rails3 software: THIS was the problem

The bin files are clashing.

I solved it by uninstalling the initial installation of ruby1.9.3

pb2q
  • 58,613
  • 19
  • 146
  • 147
0

After reinsntalling again to make sure I didn't miss anything, there is an option to add ruby executables to the path. I missed this during the installations.

Sturm
  • 4,105
  • 3
  • 24
  • 39