I've installed ruby 1.8.6 p368 and gems 1.3.4 as well as required libraries like zlib, ssl or readline on my winxp sp3 box.
The problem is, when I now try to use some gem, I get the following error:
Exception `LoadError' at D:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:1112 - no su
ch file to load -- rubygems/defaults/operating_system
Exception `LoadError' at D:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.
rb:31 - no such file to load -- mysql
Seems like it makes sense to start with fixing the missing "rubygems/defaults/operating_system" file. How can I do that? TIA
PS:
gem env is
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.4
- RUBY VERSION: 1.8.6 (2009-03-31 patchlevel 368) [i386-mswin32]
- INSTALLATION DIRECTORY: D:/ruby/lib/ruby/gems/1.8
- RUBY EXECUTABLE: D:/ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: D:/ruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mswin32-60
- GEM PATHS:
- D:/ruby/lib/ruby/gems/1.8
- C:/Documents and Settings/fluffy/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/
Were you running using -d? If so, this email reckons that it's displaying exceptions even when they're rescued.
It looks like you need the mysql gem too.
The following error
Exception 'LoadError' at D:/ruby/lib/ruby/site_ruby/1.8/rubygems.rb:1112 - no such file to load -- rubygems/defaults/operating_system
Can relate to either
a corrupt installation (check the rubygems.rb file and make sure it requires 'rubygems/defaults/operating_system'. If it does, check to see if it exists) or
you're trying to run a 2.3.x app while the server is still configured to using Rails 2.1.x
I hope this helps. If not, let me know.
Have you tried InstantRails? It has rails/apache/mysql in a nice package and worked out of the box on every XP box I tried.
I also install NetBeans as dev environment and just point it to InstantRails "bin/ruby" binary.
Related
I am trying to get a project to work that was created through RubyMine. I have an ultimate version of IntelliJ and would rather use that with the Ruby plugin to run these tests.
However when I attempt to run I get an error saying "No Rspec gem found in SDK". I havent
My Gem environment looks like this:
mac:~ cmietzner$ gem environment
RubyGems Environment:
- RUBYGEMS VERSION: 2.4.7
- RUBY VERSION: 2.2.1 (2015-02-26 patchlevel 85) [x86_64-darwin14]
- INSTALLATION DIRECTORY: /Users/colemietzner/.rvm/gems/ruby-2.2.1
- RUBY EXECUTABLE: /Users/colemietzner/.rvm/rubies/ruby-2.2.1/bin/ruby
- EXECUTABLE DIRECTORY: /Users/colemietzner/.rvm/gems/ruby-2.2.1/bin
- SPEC CACHE DIRECTORY: /Users/colemietzner/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-14
- GEM PATHS:
- /Users/colemietzner/.rvm/gems/ruby-2.2.1
- /Users/colemietzner/.rvm/gems/ruby-2.2.1#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/colemietzner/.rvm/gems/ruby-2.2.1/bin
- /Users/colemietzner/.rvm/gems/ruby-2.2.1#global/bin
- /Users/colemietzner/.rvm/rubies/ruby-2.2.1/bin
- /usr/local/bin
- /usr/bin
- /bin
- /usr/sbin
- /sbin
- /usr/local/git/bin
- /Users/colemietzner/.rvm/bin
Your problem is that IntelliJ created your mobile as a Java-oriented module. One can tell by the little blue square next to the module name.
This fixed it for me:
Open Project Structure
Click on Modules under Project Settings
Delete the module (via -)
Add a new module, and choose Ruby (or rails, or whatever you need)
I realise this is an old question but I ran into the same problem and solved it as follows:
The Problem:
In the intelliJ configuration screen shown in the screenshot above (found in "Run" > "edit configurations"), you can see the configuration is trying to "Choose the SDK from the module". And of course there are no Ruby binaries inside the module (the project directory) so it throws the "No SDK found" error.
The solution:
(Assuming all the appropriate gems have been $ bundle install'd) I found the solution was to select "Use other SDK and 'rspec' gem:" and choose the appropriate SDK. BUT to ensure this applies to the whole project, I replicated this change in "Defaults" configuration for both Ruby and RSpec.
e.g for Ruby settings:
and for RSpec settings:
I am using:
TextMate: version 2.0-alpha.9511
rvm: 1.25.15 (stable)
ruby: version 2.1.0p0
oh-my-zshell: 5.0.2
Mac OS X: 10.9.1 (Mavericks)
I have rvm and textmate set up to use
TM_RUBY=/Users/<myuser>/.rvm/bin/rvm-auto-ruby
The problem:
when I try to run my rake tasks using the rake bundle in textmate, I get some errors about the file not loading: "cannot load such file -- rubocop/rake_task"
The clue:
I changed my rakefile so that it simply reports the "gem env" for the default task.
When I then run the task, I see a completely different gem environment, than I would see if I used rake at the terminal command line.
RakeMate v2.0.0
>>> /Users/Johno/Projects/puzzles/triangle/Rakefile
RubyGems Environment:
- RUBYGEMS VERSION: 2.0.3
- RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [universal.x86_64-darwin13]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/2.0.0
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-13
- GEM PATHS:
- /Library/Ruby/Gems/2.0.0
- /Users/Johno/.gem/ruby/2.0.0
- /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/gems/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
Whereas I see this when running
$ gem env
in my terminal, for my project
RubyGems Environment:
- RUBYGEMS VERSION: 2.2.0.rc.1
- RUBY VERSION: 2.1.0 (2013-12-25 patchlevel 0) [x86_64-darwin12.0]
- INSTALLATION DIRECTORY: /Users/Johno/.rvm/gems/ruby-2.1.0#puzzles
- RUBY EXECUTABLE: /Users/Johno/.rvm/rubies/ruby-2.1.0/bin/ruby
- EXECUTABLE DIRECTORY: /Users/Johno/.rvm/gems/ruby-2.1.0#puzzles/bin
- SPEC CACHE DIRECTORY: /Users/Johno/.gem/specs
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-darwin-12
- GEM PATHS:
- /Users/Johno/.rvm/gems/ruby-2.1.0#puzzles
- /Users/Johno/.rvm/gems/ruby-2.1.0#global
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /Users/Johno/.rvm/gems/ruby-2.1.0#puzzles/bin
- /Users/Johno/.rvm/gems/ruby-2.1.0#global/bin
- /Users/Johno/.rvm/rubies/ruby-2.1.0/bin
- /Users/Johno/.rvm/bin
- /usr/local/bin
- /Users/Johno/Projects/Scripts/Ruby
- /Users/Johno/Projects/Scripts/bash
- /Users/Johno/Projects/Scripts/perl
- /Users/Johno/Projects/Scripts/Geek Tool
- /usr/bin
- /bin
I suspect that textmate is trying to use the "wrong" rake, or failing to set up the environment properly.
I think the problem may lie in the ruby bundle command from text mate:
#!/usr/bin/env bash
export RUBYLIB="$TM_BUNDLE_SUPPORT/RakeMate${RUBYLIB:+:$RUBYLIB}"
export TM_RAKE=$(which "${TM_RAKE:-rake}")
"/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby" -- "$TM_BUNDLE_SUPPORT/RakeMate/rake_mate.rb"
It appears to be using a specific ruby (1.8) rather than the rvm project specific ruby
Does anyone have a suggestion as to how to resolve this?
Thank you,
John Schank
Followed the advice to set TM_RAKE and it didn't help.
I tried both the suggested setting, and using the results of which rake
/Users/Johno/.rvm/gems/ruby-2.1.0#puzzles/bin/rake
When using my TM_RAKE, is get a different error
RakeMate v2.0.0
>>> /Users/Johno/Projects/puzzles/triangle/Rakefile
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:296:in `to_specs': Could not find 'rake' (>= 0) among 5 total gem(s) (Gem::LoadError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/dependency.rb:307:in `to_spec'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:47:in `gem'
from /Users/Johno/.rvm/gems/ruby-2.1.0#puzzles/bin/rake:22:in `<main>'
This happens to be the same error I get when I try to use the rubocop.tmbundle
It still looks to me like the gem environment is not being passed to the child process.
I solved my own problem.
Here are the details for anyone else who has this problem...
First, the answer in this question TextMate, rvm and TM_RUBY
is almost perfect.
I had to create a textmate_ruby, and a textmate_rake script, and reference them in the variables in text mate: TM_RUBY, and TM_RAKE.
Second, since I'm using zsh, I had to change the shebang line in the textmate_xxx scripts to use zsh.
Finally, the key that helped me arrive at the correct solution is that I modified my project rakefile to :
task :default do
system "gem env"
system "ruby --version"
system "pwd"
system "printenv"
end
Then when I ran the rake task in textmate, it would dump the current values of my environment, ruby version, current directory, and gem environment. This really helped to see what was going on.
It seems that TextMate is still using your system rake instead of rvm's.
Try to set TM_RAKE in addition to TM_RUBY:
TM_RAKE=$HOME/.rvm/bin/rake
This also applies to rbenv, where you would set TM_RAKE to $HOME/.rbenv/shims/rake.
I'm new to ruby and I have a problem loading gems.
I've read every topic about this on SO but I couldn't figure out how to make it work :/
I'm on a fresh install of Ruby 1.9.3 and RubyGems 1.8.11
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.11
- RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [i386-mingw32]
- INSTALLATION DIRECTORY: D:/dev/Ruby/lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: D:/dev/Ruby/bin/ruby.exe
- EXECUTABLE DIRECTORY: D:/dev/Ruby/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-mingw32
- GEM PATHS:
- D:/dev/Ruby/lib/ruby/gems/1.9.1
- D:/aoi/.gem/ruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
I've installed the gem twice, once from command line
gem install soap4r
And second time i've tried to use RubyMine installer, but the result where the same,
when I try to
require 'rubygems'
resuire 'soap'
The output is the same :
LoadError: cannot load such file -- soap
from D:/dev/Ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from D:/dev/Ruby/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from (irb):1
from D:/dev/Ruby/bin/irb:12:in `<main>'
Thank you for your help.
Get this https://github.com/spox/soap4r-spox and patch your ruby with it, its the default soap module for ruby but was pulled out of 1.9 versions
Try to add this to the top of your file:
gem 'soap4r'
require 'soap/wsdlDriver'
Or as an alternative try Savon
Have you checked that you do not run multiple different ruby versions ? Then your gems are not bound to the correct ruby version.
Moreover, I notice something strange :
http://rubygems.org/gems/soap : "This gem has been yanked, but it is still available for download for other gems that may have depended on it"
On the contrary, there seems to be another more interesting gem around : soap4r.
There is a tuto here. I especially noticed that sort of lines :
require "soap/rpc/standaloneserver"
That means "require soap" may not be sufficient in your case.
I am brand new to Ruby as of today. I installed IronRuby as I am a .NET developer and it seems to have a lighter footprint for Windows 7.
Things have been proceeding well, until I needed to install a Gem to parse HTML. I am issuing the following command:
igem install rokogiri
and receiving the following error:
ERROR: While executing gem ... (NoMethodError)
undefined method `set_params' for #<OpenSSL::SSL::SSLContext:0x00001ba>
Running igem env yields:
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.9.2 (2010-08-18 patchlevel 0) [i386-mswin32]
- INSTALLATION DIRECTORY: C:/Program Files (x86)/IronRuby 1.1/Lib/ruby/gems/1.9.1
- RUBY EXECUTABLE: "C:/Program Files (x86)/IronRuby 1.1/bin/ir.exe"
- EXECUTABLE DIRECTORY: C:/Program Files (x86)/IronRuby 1.1/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-dotnet-4.0
- GEM PATHS:
- C:/Program Files (x86)/IronRuby 1.1/Lib/ruby/gems/1.9.1
- P:/.gem/ironruby/1.9.1
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://rubygems.org/
My searches on Google have been fruitless. Does anyone have any suggestions?
Thanks!
The error happens in using OpenSSL library.
So this problem can be solved to use ruby standard OpenSSL library, not the library of IronRuby.
I think you can install the library in the following procedure.
Invalidate the function of SSL verifying once.
Add the next line to ~/.gemrc(%HOME%\.gemrc) file.
(if it doesn't exit, create)
:ssl_verify_mode: 0
In this, 'igem' is usabled.
But this state isn't recommend.
Install OpenSSL library, like this :
> igem install rubysl-openssl
And, restore ~/.gemrc file.
'igem' remains to be usabled.
For anyone else that comes across this a solution that worked for me was to use the standard Ruby gem command and set the install directory to the IronRuby gem location.
gem install --install-dir "c:/Program Files (x86)/IronRuby 1.1/lib/ironruby/gems/1.8" -V json_pure
igem does look like it's a very basic Ruby script that wraps up the Ruby gem command. The OpenSSL error seems to be a bit of a red herring and is probably because the default gem repository URL now redirects to a different location and the igem script doesn't deal with that.
I havent been been able to install any Gem since I updated to Mac OSX Lion.
Every time I try to install any gem the terminal window hangs.
I've uninstalled everything including ruby and reinstalled Ruby Gems but that didn't solve the problem.
After running:
gem install rails --debug
I get this (only first lines shown):
Exception `NameError' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:177 - uninitialized constant Gem::Commands::InstallCommand
Exception `LoadError' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36 - no such file to load -- psych
Exception `LoadError' at /opt/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:62 - no such file to load -- psych
Exception `Errno::EEXIST' at /opt/local/lib/ruby/1.8/fileutils.rb:243 - File exists - /Users/marcogallen/.gem/specs/rubygems.org%80
Exception `Errno::EEXIST' at /opt/local/lib/ruby/1.8/fileutils.rb:243 - File exists - /Users/marcogallen/.gem/specs/gems.github.com%80
Exception `EOFError' at /opt/local/lib/ruby/1.8/net/protocol.rb:135 - end of file reached
Exception `EOFError' at /opt/local/lib/ruby/1.8/net/protocol.rb:120 - end of file reached
Exception `EOFError' at /opt/local/lib/ruby/1.8/net/http.rb:1060 - end of file reached
GEM env gives this:
RubyGems Environment:
- RUBYGEMS VERSION: 1.8.8
- RUBY VERSION: 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin11]
- INSTALLATION DIRECTORY: /opt/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /opt/local/bin/ruby
- EXECUTABLE DIRECTORY: /opt/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-darwin-11
- GEM PATHS:
- /opt/local/lib/ruby/gems/1.8
- /Users/[user]/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://rubygems.org/", "http://gems.github.com"]
- REMOTE SOURCES:
- http://rubygems.org/
- http://gems.github.com
I'm totally clueless here, I hope some one can give me a hint or something.
MAC Book PRO running OSX Lion
Thanks
Marco
Hey I had a really similar problem,
I upgraded to Ruby 1.9.2 using RVM Click here!
It has its own way of managing Gems for each instance of Ruby and helped me understand where the gems were kept etc... If you have a read you should get there!
If it doesn't help I am sorry, but might be worth a try!