2
votes

I already used Rails on my machine, but I decided to reinstall it because the gems were acting up because of a special character in my home directory where the gem repository used to be.

So I uninstalled ruby using rubyinstaller's uninstaller, deleted all my gem folders, rubygems etc etc.

Now I set my GEM_HOME path to c:\GemRepository, reinstalled ruby and rubygems and devkit. when I run gem install rails, I get this:

Successfully installed rails-3.1.3
1 gem installed
Installing ri documentation for rails-3.1.3...
file 'lib' not found
Installing RDoc documentation for rails-3.1.3...
file 'lib' not found

If i try to run rails, it says "'rails' is not recognized as an internal or external command, operable program or batch file."

I also tried installing with the -include-dependencies flag, but then I get

Fetching: multi_json-1.0.4.gem (100%)
Fetching: rails-3.1.3.gem (100%)
Successfully installed multi_json-1.0.4
Successfully installed rails-3.1.3
2 gems installed
Installing ri documentation for multi_json-1.0.4...
Installing ri documentation for rails-3.1.3...
file 'lib' not found
Installing RDoc documentation for multi_json-1.0.4...
Installing RDoc documentation for rails-3.1.3...
file 'lib' not found

And again, rails is not recognized as a command. Please, please, help me.

3

3 Answers

2
votes

First, enter the command: gem environment gemdir Then cd to the directory shown. cd to the sub-directory bin and find the full path to bin. Then add this to your PATH.

2
votes

In the end I figured out that the root of the problem was that the 'home' folder in Windows is in a path that contains my user name, and my user name happens to contain the special character 'á' (Zoltán).

After struggling for quite a while, I created another user on my machine with no special characters and everything works fine now.

1
votes

I was installing rubyinstaller-2.1.7-x64.exe

Search for file railties-4.2.5.gem, on my pc it is located in c:\Ruby21\lib\ruby\gems\2.1.0\cache\railties-4.2.5.gem

Type:

gem install c:\Ruby21\lib\ruby\gems\2.1.0\cache\railties-4.2.5.gem --local

And try to call : rails -v It is should working and show Rails 4.2.5