Ruby Gems on Windows - windows

I have removed and reinstalled ruby on my machine (windows 7, ruby 1.9.1). When I go to get rails again I get: While executing gem... File Exists C:
Yet when I list my gems is says none are installed.
What gives?

This is a permissions issue. On Windows, you need to run as admin when you're installing gems.

Related

Windows system can't call ruby or gem

After I installed ruby, type ruby ​​or gem in cmd and there is no such command.
And I have added the installation path to the system environment.
I did this, but it didn't work. But now it's done, because I installed ruby ​​on a non-system disk before, so there will be some strange problems.

Installing Ruby version 2.2.4 on Windows 7

I had an old version of Ruby (1.9.3) that I am using with Selenium Webdriver.But I was getting errors while running my script.So I downloaded Ruby installer 2.2.4 version and ran it. Can someone tell me what is the command line steps to fully install it ? I tried "gem update --system" and I get the error "error fetching data". I tried "gem install ruby" and it says "successfully installed rubyzip 1.1.7"
Installing Ruby on Windows is best done by downloading the installer from the Ruby Installer site and executing the binary. There are a few things to look out for:
Make sure the correct Ruby is in your PATH. E.g.:
echo %PATH%
should include a string like C:\Ruby200\bin. The installation path may be different for your version of Ruby. If you are installing a new version, you might need to edit the path using the Windows dialog so that new sessions include it.
Also, read the instructions for installing the Ruby DevKit. You'll need it for installation of gems with native extensions.
Once Ruby is installed correctly you should be able to run ruby -v in a command window to see that the expected version is there.
\

Trouble with sqlite3 ruby 2.0 on Windows

I'm a newbie to programming, with ruby/rails successfully installed on my (mac) home computer. I'm trying to get ruby 2.0.0p195 (and Rails) set up on Windows at work (Windows 7, 32bit) and I'm failing on the sqlite3 installation. I've been through most of the solutions/suggestions I can find on the web, but just can't get it to work - the frustrating thing is that it tells me it's installed, but it doesn't work:
- I've tried the knapsack installation http://www.ruby-forum.com/topic/4413168
- If I try to install --with-opt-dir=c:/sqlite3 (or any of the many variations suggested) it gives a native extension error.
- I've put the .dll file in Ruby/bin, which is also in my PATH
- I have the devkit installed
The 'gem install sqlite3' command is successful, and if I do 'gem list', sqlite3 v1.3.7 x86-mingw32 appears in the list, but if I 'require sqlite3' in IRB I get:
LoadError: cannot load such file -- sqlite3/sqlite3_native
And the mkmf log says:
find_header: checking for sqlite3.h... -------------------- no
But I've confirmed the sqlite3.h file (and the sqlite3.c, sqlite3.o, and sqlite3.h files) is in my c:\sqlite3 directory, and as noted above, I've also tried installing '--with-opt-dir'.
So next I trace the error when I 'require' sqlite to a file '\kernel_require.rb' in ruby/lib, and it references to this:
if Gem::Specification.unresolved_deps.empty? then
return gem_original_require(path)
end
I'm lost, and WAY out of my depth. At this point my only solution would be either to completely uninstall and start again, or to downgrade to ruby 1.9.x, but others seem to have sqlite3 and ruby 2.0 working so it's obviously (?) semi-stable. Help?
UPDATE: I've now tried downgrading to ruby 1.9.3, and apart from pik reverting to the most recent version of ruby every time I shut the command line, I can actually get the server to run etc. So it seems this issue is related specifically to ruby 2.0.
I am encountering the same issue, except that I don't really think that it is related to Ruby 2, but to rails 4 instead.
I have managed to install the sqlite3 gem by downloading the source, dll and exec (dll and executables need to be added to PATH accessible) and installying the gem with the follwing process:
Download:
http://www.sqlite.org/2013/sqlite-amalgamation-3071700.zip
http://www.sqlite.org/2013/sqlite-dll-win32-x86-3071700.zip
Extract and put the files in a location on your C drive or wherever you want. Then copy sqlite.dll and sqlite.def to the Ruby/bin directory.
Then you go to the DevKit directory and run msys.bat, in which you issue the following command:
gem install sqlite3 --platform=ruby -- --with-sqlite3-dir=path-to-sqlite --with-sqlite3-include=path-to-sqlite
This allowed me to install the gem successfully (using Ruby-2.0.0-p247 x86 and devkit). I validated through irb doing:
require 'sqlite3'
SQLite3::SQLITE_VERSION
I'm still trying to figure out this issue.
I get the same error message when I try to start the server or whenever I try to run the rails console.
I'd love to get this issue fixed...

Ruby on rails installer issue in windows 7 pc

I just have installed in my windows machine form railsinstaller.org.
Now earlier I have already installed in my machine Ruby2.0. So when I am trying to run the below command from the command prompt as mentioned here:
rails s
getting error as :
C:/Ruby200/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not f
nd 'railties' (>= 0) among 8 total gem(s) (Gem::LoadError)
from C:/Ruby200/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `g
m'
from C:/RailsInstaller/Ruby1.9.3/bin/rails:22:in `<main>'
Now if I uninstall the Ruby2.0 things are set. But I want also to be workable in my pc the latest version of Ruby,so that I can run my practice ruby programs as I could earlier. - Please instruct me ,so that I can run my Rails and only ruby programs from my Sublime Text 2 editor without impact.
Try using the installer from this site: http://rubyinstaller.org/
After it installs, install ruby by opening the command prompt and typing:
gem install rails
that should install rails and its dependancies. From there you can just run the rails command and create projects like usual.
Perhaps you should have a look at https://github.com/vertiginous/pik/ to manage different ruby versions. I think, that the main problem you got is simply, that the PATH-settings for both rails versions (1.9.3 used in railsinstaller and 2.0) are interfering.

Ruby on Windows7 - could not find gem

I'm setting up a ruby Apache Buildr on a fresh Windows 7 machine.
I've installed Ruby, the DevKit and installed buildr via
gem install buildr
wich all ran perfect.
Until I tried to execute buildr, then I get an error.
buildr compile
C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find buildr (>= 0) amongst [atoulme-Antwrap-0.7.1, builder-2.1.2, buildr-1.4.5-x86-mswin32, buildr-as3-0.2.12, diff-lcs-1.1.2,highline-1.5.1, hoe-2.3.3, json_pure-1.4.3, minitar-0.5.3, minitest-1.6.0, net-sftp-2.0.4, net-ssh-2.0.23, rake-0.8.7, rdoc-2.5.8, rjb-1.3.2-x86-mswin32-60, rspec-2.1.0, rspec-core-2.1.0,rspec-expectations-2.1.0, rspec-mocks-2.1.0, rubyforge-2.0.3, rubygems-update-1.8.4, rubyzip-0.9.4, xml-simple-1.0.12] (Gem::LoadError)
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from C:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems.rb:1182:in `gem'
from C:/Ruby192/bin/buildr:18:in `<main>'
When I list all the gems with
gem list buildr
Everything seems to match up, and this error makes no sense at all.
Any ideas?
Help would be great, I'm getting desperate now. :)
Had the same problem. I have Windows 7 x64 so installed again with gem install buildr --platform mswin64 and it worked.
I had a similar problem in the past.
My problem was the kind of installation.
I installed ruby as admin (target was c:\program files). Everything worked fine - until I installed a gem as normal user (not admin).
What happened on windows side? I have no authorization for c:\program files, the gem was installed in another directory (No, there was no error, Windows just decided to use another directory. This bug/feature is called 'Virtual Store').
In the end Ruby had problems to find the files.
My solution:
Install ruby as normal user outside c:\program files.
Maybe it is enough, when you install your gems as admin (but attention: if you have once files in your Virtual store, they are read always first.).
Installed Ruby 1.8.7 instead and it works now.

Resources