Because of a bug with Float#round in Ruby 1.8.6, I was forced to upgrade to 1.9.3 and boy was that awful. After install, irb didn't work, complaining of a lack of psych. So I tried to install the gem, but it was angry that libyaml didn't exist, so I installed that. Not sure why they weren't included if they were so important.
Now when I use require 'Location.rb' (after having to specify that I actually do want to look in the current folder... using $LOAD_PATH), I get this error:
LoadError: cannot load such file -- crack/xml
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/ap-0.1.1/lib/ap.rb:2:in `<top (required)>'
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from /Users/tyre77/Dropbox/Aurora/GMap.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from (irb):3
from /usr/local/bin/irb:12:in `<main>'
What does this mean? Also, when I execute ruby -v, it lists my version as 1.9.3p0 but this is dicking around in 1.9.1? All I want is my irb back and working!
It turned out that Ruby was looking for an XML parser called 'crack'. I don't know why it is referencing 2 versions of Ruby or why these dependencies aren't included in the Ruby build (since irb won't work without them) but to fix I installed the crack gem. sudo gem install crack
you can use
require_relative 'Location.rb'
or
require './Location.rb'
Related
This is the first time I've attempted to work with Ruby. I wanted to install sass so I updated gem and attempt to install sass but was thrown an error. I then realized that the syntax error was raised whenever I ran gem - I can't figure out what could be causing this and all other similar cases happen to people in their code, not when they just run the command.
I haven't touched the source code or even used the gem command up to this point. The error is a syntaxerror, specifically:
$ gem
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': /Library/Ruby/Gems/2.0.0/gems/psych-3.0.0/lib/psych/scalar_scanner.rb:146: syntax error, unexpected tIDENTIFIER, expecting ')' (SyntaxError)
klass.new(yy, m, dd, hh, mm, ss+us/(1_000_000r), offset)
^
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/psych-3.0.0/lib/psych/nodes/node.rb:4:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/psych-3.0.0/lib/psych/nodes.rb:2:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Library/Ruby/Gems/2.0.0/gems/psych-3.0.0/lib/psych.rb:14:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems.rb:585:in `load_yaml'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/config_file.rb:314:in `load_file'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/config_file.rb:191:in `initialize'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `new'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:66:in `do_configuration'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/gem_runner.rb:46:in `run'
from /usr/bin/gem:21:in `<main>'
This is a known bug in the gemspec of Psych 3.0.0, which lists the required Ruby version as >= 1.9.2, even though Psych 3.0.0 actually requires Ruby 2.2.2 (the specific syntax that causes the error in your case was introduced in Ruby 2.1):
s.required_ruby_version = Gem::Requirement.new(">= 1.9.2")
The problem has been fixed in the repository, but there has not yet been a release incorporating that fix.
The necessary steps to fix your problem are mentioned in the bug report, basically you need to delete the b0rked Psych 3.0.0 gem directory manually, then you can uninstall Psych 3.0.0, and after that, you need to ensure that you don't install 3.0.0 again:
FYI, for anyone landing on the issue as described in the first post, where even the gem command won't even work:
You must rm -rf psych 3.0.0's gem directory. (after that, the gem command should work)
Then you can do gem uninstall psych -v 3.0.0.
Then, until version 3.0.0 gets fixed, you must add gem 'psych', '< 3.0.0' to your Gemfile.
You might have to run bundle update for it to accept your change of psych's version.
Whenever I try to run my Ruby program I get this error:
C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in require': cannot load such file -- ffi_c (LoadError)
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:inrescue in require'
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ffi-1.9.10-x64-mingw32/lib/ffi.rb:6:inrescue in '
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/ffi-1.9.10-x64-mingw32/lib/ffi.rb:3:in <top (required)>'
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:inrequire'
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0-x64-mingw32/lib/restclient/windows/root_certs.rb:2:in'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0-x64-mingw32/lib/restclient/windows.rb:7:in require_relative'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0-x64-mingw32/lib/restclient/windows.rb:7:in'
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in require'
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:inrequire'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0-x64-mingw32/lib/restclient.rb:16:in <top (required)>'
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:inrequire'
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:120:in require'
from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0-x64-mingw32/lib/rest_client.rb:2:in'
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:in require'
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:127:inrescue in require'
from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from form_response_transfer.rb:3:in [main method]
The program (form_response_transfer.rb) used to work fine, but now, there seems to be some problem with my rest-client gem. I haven't changed any of the code in the program since it last worked, so I'm not sure exactly what I did to cause this error. In general, gems that end with X64-mingw32 have been giving me problems lately (some other examples include nokogiri, sqlite3, and pg). How should I go about trying to fix this error? Could there be some problem with how Ruby is set up on my computer?
Try to uninstall FFI gem
gem uninstall ffi
and then reinstall it with below command:
gem install ffi --platform=ruby
It worked on my side (Win7 x64)
I'm using Ruby on Rails, and I installed all the necessary applications and updates for gems. I already exhausted/researched most of all possible answer for this error and tried all of it, but still am having no luck.
/Users/u=Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activesupport-3.2.13/lib/active_support/values/time_zone.rb:270: warning: circular argument reference - now
/Users/Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.8.5/lib/bundler/runtime.rb:76:in `require': cannot load such file -- false (LoadError)
from /Users/Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.8.5/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
from /Users/Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.8.5/lib/bundler/runtime.rb:72:in `each'
from /Users/Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.8.5/lib/bundler/runtime.rb:72:in `block in require'
from /Users/Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.8.5/lib/bundler/runtime.rb:61:in `each'
from /Users/Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.8.5/lib/bundler/runtime.rb:61:in `require'
from /Users/Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/bundler-1.8.5/lib/bundler.rb:134:in `require'
from /Users/Username/Downloads/job4quote/config/application.rb:7:in `'
from /Users/Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-3.2.13/lib/rails/commands.rb:53:in `require'
from /Users/Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-3.2.13/lib/rails/commands.rb:53:in `block in '
from /Users/Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `tap'
from /Users/Username/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/railties-3.2.13/lib/rails/commands.rb:50:in `'
from script/rails:6:in `require'
from script/rails:6:in `'
Is there a way to access these .rb files to make necessary changes?
As shown here -> warning: circular argument reference
The problem seems to be caused by the higher version of ruby (In my case rails 3.2.13 and ruby 2.2) and using an older version of rails. One solution in which worked for me was to use ruby 2.0 and to update my gem file (RVM Capistrano).
gem 'rvm-capistrano', require: false
run the bundle install command. After that everything worked as expected.
silly of me, you can access the file by browsing it thru terminal
$ open .rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/activesupport-3.2.13/lib/active_support/values
and made changes on that file as shown on the link about.
Sorry new with ruby.
I follow the below guideline to install the linalg for Ruby env.
http://www.quora.com/Installation-Instructions/How-do-I-install-Ruby-linalg-library-on-Mac
It works, but when I try to require the lib in 'irb', it raise the error.
Environment: Ruby:2.0.0-p0 lapack:3.5.0 (I also tried 3.4.0)
I already spend on 3 hours but didn't figure out the problem.
Here's the error, when I try to require the lib in command line.
It seems somewhere use 18 as parameter which exceed the max value as -2..15.
2.0.0-p0 :002 > require 'linalg'
ArgumentError: arity out of range: 18 for -2..15
from /Users/xxx/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/xxx/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/xxx/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/linalg.rb:7:in `<top (required)>'
from /Users/xxx/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Users/xxx/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from (irb):2
from /Users/xxx/.rvm/rubies/ruby-2.0.0-p0/bin/irb:16:in `<main>'
I did fork and fixed compile for ruby 2/2.1.
You can try this fork: https://github.com/parallel588/linalg
I know that rb-appscript is officially no longer supported.
However, I tried and found that rewriting existing libraries to use alternative methods (e.g. osascript) was a non-trivial work and it occurred to me that monkey-patching rb-appscript to work again seemed like a better approach, if ever possible.
Here's what happens.
$ rvm 2.0.0
$ gem install rb-appscript
$ irb
> require 'appscript'
LoadError: cannot load such file -- _aem/mactypes
from ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from ruby-2.0.0-p0/gems/rb-appscript-0.6.1/lib/appscript.rb:8:in `<top (required)>'
from ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `require'
from ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:110:in `rescue in require'
from ruby-2.0.0-p0/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:35:in `require'
What change in Ruby 2.0.0 is causing this?
It seems that there was a bug in Rubygems 2.0.0, and upgrading to 2.0.2 by
gem update --system
fixed the problem.