Rails 4 binstubs errors - ruby-on-rails-4

I was playing around with bundler and binstubs and "rake rails:update:bin" and the next time I tried to run rails s i got this exception:
`inherited': undefined method `application' for Rails:Module (NoMethodError)
The same exception appears even for new projects that I create and try to run.
Here's the full text:
C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/application.rb:63:in `inherited': undefined method `application' for Rails:Module (NoMethodError)
from F:/aptana projects/testy/config/application.rb:10:in `<module:Testy>'
from F:/aptana projects/testy/config/application.rb:9:in `<top (required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
from C:/Ruby200/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'

Well, a few minutes after posting this I tried:
gem uninstall railties
and then again
bundle install
and it resolved the issue. I still have no idea what might have happened in the first place though.

Related

Rails NoMethodError: undefined method new for BigDecimal:Class

My app is on:
ruby-2.6.4
Rails 4.2.8
activerecord-4.2.8
I'm upgrading a rails app to ruby-2.6.4 When running a rake task in development, for testing, I am getting errors for BigDecimal() and .../vendor/bundle/ruby/2.6.0/gems/ruby-oci8/...
ArgumentError: invalid value for BigDecimal(): "0.E+00"
/sha/git/sha_human_resources/shared/bundle/ruby/2.6.0/gems/ruby-oci8-2.1.8/lib/oci8/bindtype.rb:35:in `BigDecimal'
...
.../vendor/bundle/ruby/2.6.0/gems/ruby-oci8-2.1.8/lib/oci8/bindtype.rb:216: warning: constant ::Fixnum is deprecated
.../vendor/bundle/ruby/2.6.0/gems/ruby-oci8-2.1.8/lib/oci8/bindtype.rb:219: warning: constant ::Bignum is deprecated
.../vendor/bundle/ruby/2.6.0/gems/ruby-oci8-2.1.8/lib/oci8/compat.rb:73: warning: constant ::Fixnum is deprecated
I found a couple threads about updating the bigdecimal and oci8 gems, so tried a couple versions and found these helped: git diff Gemfile:
-gem 'ruby-oci8', '~> 2.1.5'
+gem 'ruby-oci8', '~> 2.2.8'
and added a bigdecimal gem:
+gem "bigdecimal", ">= 2.0.0"
Now when I run my rake task, I get this error:
rake aborted!
NoMethodError: undefined method `new' for BigDecimal:Class
.../vendor/bundle/ruby/2.6.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/duplicable.rb:111:in `<class:BigDecimal>'
.../vendor/bundle/ruby/2.6.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object/duplicable.rb:106:in `<top (required)>'
.../vendor/bundle/ruby/2.6.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object.rb:3:in `require'
.../vendor/bundle/ruby/2.6.0/gems/activesupport-4.2.8/lib/active_support/core_ext/object.rb:3:in `<top (required)>'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails/configuration.rb:2:in `require'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails/configuration.rb:2:in `<top (required)>'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails/railtie.rb:2:in `require'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails/railtie.rb:2:in `<top (required)>'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails/engine.rb:1:in `require'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails/engine.rb:1:in `<top (required)>'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails/application.rb:7:in `require'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails/application.rb:7:in `<top (required)>'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails.rb:11:in `require'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails.rb:11:in `<top (required)>'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails/all.rb:1:in `require'
.../vendor/bundle/ruby/2.6.0/gems/railties-4.2.8/lib/rails/all.rb:1:in `<top (required)>'
.../config/application.rb:3:in `require'
.../config/application.rb:3:in `<top (required)>'
.../Rakefile:6:in `require'
.../Rakefile:6:in `<top (required)>'
/usr/local/rvm/rubies/ruby-2.6.4/bin/bundle:30:in `block in <main>'
/usr/local/rvm/rubies/ruby-2.6.4/bin/bundle:22:in `<main>'
/usr/local/rvm/gems/ruby-2.6.4/bin/ruby_executable_hooks:24:in `eval'
/usr/local/rvm/gems/ruby-2.6.4/bin/ruby_executable_hooks:24:in `<main>'
Doing more Google surfing, I found there is not a lot of info on solving this. I did see a couple mentions of upgrading to the latest version of rails. Is this a must to solve this? Is there a monkeypatch or fix out there that can solve/fix/prevent this until we are ready to upgrade our rails version? I feel we will always be chasing the carrot-on-the-stick that is the latest version of rails.
Thanks for any advice.
As per the documentation of BigDecimal, for all Ruby versions 2.6.x, you should be using BigDecimal with a specific version:
The differences among versions are given below:
version characteristics Supported ruby version range
2.0.0 You cannot use BigDecimal.new and do subclassing 2.4 ..
1.4.x BigDecimal.new and subclassing always prints warning. 2.3 .. 2.6
1.3.5 You can use BigDecimal.new and subclassing without warning .. 2.5
You can select the version you want to use using gem method in Gemfile or scripts. For example, you want to stick bigdecimal version 1.3.5, it works file to put the following gem call in you Gemfile.
gem 'bigdecimal', '1.3.5'

Unable to deploy to Digital Ocean VPS using Capistrano because of JSON::GeneratorError: source sequence is illegal/malformed utf-8

I have searched for hours for a solution to this issue with no avail. I can't seem to be able to fix this.
*cap production deploy * throws the following error as shown in the log.
This solution doesn't help.
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy#xxx.xxx.xx.xxx: rake exit status: 1
rake stdout: rake aborted!
JSON::GeneratorError: source sequence is illegal/malformed utf-8
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/json-1.8.3/lib/json/common.rb:223:in `generate'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/json-1.8.3/lib/json/common.rb:223:in `generate'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/execjs-2.6.0/lib/execjs/external_runtime.rb:46:in `call'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/uglifier-2.7.2/lib/uglifier.rb:212:in `run_uglifyjs'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/uglifier-2.7.2/lib/uglifier.rb:179:in `compile'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/uglifier_compressor.rb:52:in `call'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/uglifier_compressor.rb:28:in `call'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:60:in `block in load'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:318:in `fetch_asset_from_dependency_cache'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/loader.rb:44:in `load'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:47:in `yield'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:47:in `load'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/base.rb:66:in `find_asset'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:138:in `block in find'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:223:in `block in stat_tree'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:207:in `block in stat_directory'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:204:in `each'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:204:in `stat_directory'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:222:in `stat_tree'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:105:in `each'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:104:in `each'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:104:in `logical_paths'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:136:in `find'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:162:in `compile'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-3.4.0/lib/rake/sprocketstask.rb:147:in `with_logger'
/var/www/html/app/shared/bundle/ruby/2.2.0/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
Tasks: TOP => assets:precompile
(See full trace by running task with --trace)
rake stderr: Nothing written
[1]: https://stackoverflow.com/questions/31372478/rake-aborted-jsongeneratorerror-source-sequence-is-illegal-malformed-utf-8-a
I am patiently waiting on a solution
One of the JS files being compiled contains invalid UTF-8 bytes. I don't know which one, but the way I would suggest you debug it is to locally edit the equivalent path to /var/www/html/app/shared/bundle/ruby/2.2.0/gems/json-1.8.3/lib/json/common.rb:223:ingenerate'` to wrap the breaking call in a block like:
begin
# Whatever normally goes here.
rescue JSON::GeneratorError
puts whateverliststhefilename
end
If you are already using this, you can also just drop in binding.pry instead of puts.
Once you know the filename, run it through UTF-8 validators like the one you saw in the linked SO answer, and fix it. If the JS is in a gem, try restoring the gem to a pristine condition. If the JS is in your project, fix it accordingly.
You can use http://guides.rubygems.org/command-reference/#gem-pristine to restore a modified or corrupted gem. Be sure to remove your debugging code from the gem file when you are done.
This is more of a teach how to fish answer than a "this is what is wrong and how to fix it" answer. Sorry about that, but there is no way for us to do this unless it is a commonly known issue in a gem, which a Google search would have brought up, or if we have the entire source code.
Hope this helps!

Cannot generate controller ,model or start rails server

I recently started getting problems in generating controllers,models and starting rails server in new projects. I am able to do all these things in old projects.
What can be done to resolve this error?
OS: Ubuntu 15.04 ,Ruby:2.1 ,Rails: 4.2.0
Error Output:
aditya#Aditya-PC:~/testRails/blog$ rails g controller pages
Warning: Running `gem pristine --all` to regenerate your installed gemspecs (and deleting then reinstalling your bundle if you use bundle --path) will improve the startup performance of Spring.
/var/lib/gems/2.1.0/gems/railties-4.2.0/lib/rails/railtie/configuration.rb:95:in `method_missing': undefined method `active_record' for #<Rails::Application::Configuration:0x00000002ec6c40> (NoMethodError)
from /home/aditya/testRails/blog/config/application.rb:24:in `<class:Application>'
from /home/aditya/testRails/blog/config/application.rb:10:in `<module:Blog>'
from /home/aditya/testRails/blog/config/application.rb:9:in `<top (required)>'
from /var/lib/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:82:in `require'
from /var/lib/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:82:in `preload'
from /var/lib/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:143:in `serve'
from /var/lib/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:131:in `block in run'
from /var/lib/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `loop'
from /var/lib/gems/2.1.0/gems/spring-1.3.6/lib/spring/application.rb:125:in `run'
from /var/lib/gems/2.1.0/gems/spring-1.3.6/lib/spring/application/boot.rb:18:in `<top (required)>'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
EDIT: I removed rails completely and again installed. But no effect, still having this error.
Have you tried to run bundle install in the application?
According to the error seems like you created a new rails app without activerecord
'method_missing': undefined method 'active_record' for #Rails::Application::Configuration
the stack trace is hinting at /home/aditya/testRails/blog/config/application.rb:24
If removing activerecord is intentional follow along to remove anything that is related to activerecord, if not continue reading as you might figure out what went missing ;)
remove any activerecord config from application.rb or environments/*
check your config/application.rb if
require 'rails/all is present, remove it and add the railties that you need like:
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_job/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
# require "railtie/active_record"
remove any adapter from the Gemfile (mysql2, pg, sqlite3)
remove config/database.yml
Hope it helps :)

Rails + RSpec - spec/support files not being required; giving "Uninitialized Constant (NameError)"

In my current project, I am not able to run any of the test case because I am getting the following error:
/home/harsh/Documents/viburnix/cloud/viburnix/spec/support/helpers.rb:2:in `block in <top (required)>': uninitialized constant Features (NameError)
Full trace:
/home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/http/mime_type.rb:163: warning: already initialized constant Mime::ZIP
/home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/gems/actionpack-4.1.1/lib/action_dispatch/http/mime_type.rb:163: warning: previous definition of ZIP was here
Coverage report generated for RSpec to /home/harsh/Documents/viburnix/cloud/viburnix/coverage. 11 / 56 LOC (19.64%) covered.
/home/harsh/Documents/viburnix/cloud/viburnix/spec/support/helpers.rb:2:in `block in <top (required)>': uninitialized constant Features (NameError)
from /home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/gems/rspec-core-3.0.0.beta2/lib/rspec/core.rb:112:in `configure'
from /home/harsh/Documents/viburnix/cloud/viburnix/spec/support/helpers.rb:1:in `<top (required)>'
from /home/harsh/Documents/viburnix/cloud/viburnix/spec/spec_helper.rb:16:in `block in <top (required)>'
from /home/harsh/Documents/viburnix/cloud/viburnix/spec/spec_helper.rb:16:in `each'
from /home/harsh/Documents/viburnix/cloud/viburnix/spec/spec_helper.rb:16:in `<top (required)>'
from /home/harsh/Documents/viburnix/cloud/viburnix/spec/models/user_spec.rb:1:in `require'
from /home/harsh/Documents/viburnix/cloud/viburnix/spec/models/user_spec.rb:1:in `<top (required)>'
from /home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/gems/rspec-core-3.0.0.beta2/lib/rspec/core/configuration.rb:932:in `load'
from /home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/gems/rspec-core-3.0.0.beta2/lib/rspec/core/configuration.rb:932:in `block in load_spec_files'
from /home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/gems/rspec-core-3.0.0.beta2/lib/rspec/core/configuration.rb:932:in `each'
from /home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/gems/rspec-core-3.0.0.beta2/lib/rspec/core/configuration.rb:932:in `load_spec_files'
from /home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/gems/rspec-core-3.0.0.beta2/lib/rspec/core/command_line.rb:21:in `run'
from /home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/gems/rspec-core-3.0.0.beta2/lib/rspec/core/runner.rb:100:in `run'
from /home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/gems/rspec-core-3.0.0.beta2/lib/rspec/core/runner.rb:31:in `invoke'
from /home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/gems/rspec-core-3.0.0.beta2/exe/rspec:4:in `<top (required)>'
from /home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/bin/rspec:23:in `load'
from /home/harsh/Documents/viburnix/cloud/viburnix/vendor/ruby/2.1.0/bin/rspec:23:in `<main>'
spec/spec_helper.rb is the standard file generated by spec:install and includes:
Dir[Rails.root.join("spec/support/**/*.rb")].each { |f| require f }
In spec/support/helpers.rb, I have:
RSpec.configure do |config|
config.include Features::SessionHelpers, type: :feature
config.include Mongoid::Matchers, type: :model
config.include AuthenticationHelpers, type: :controller
end
And it gives error on line 2: Features::SessionHelpers.
Seems like it is either not requiring the code at all or just not loading in correct order.
The problem is that in a team of 7, I am the only one who is not able to run spec. Any help or direction is much needed and would be appreciated.
Sorry for late reply. This project was started by another team and yes all the files, modules and classes were present at right place. The problem was the sequence of loading/requiring (in spec_helper.rb) these files. While other people were working happily without any issue, I had to load/require some of the required files earlier.
What baffles me are 2 questions:
I am not puzzled it didn't work for me. The requiring of those specific files manually make sense and should have been that way from the start. I am puzzled at how did it work for other people?
I tried making a virtual machine exactly the same way as other people. Yet I faced the issue, debunking the myth that this has to do with OS or shell etc.
I have added those lines to spec_helper.rb and I comment them after running tests but before committing my work.

Jruby LoadError: Could not open any of [xml2, xslt, exslt] WINDOWS

I am running on windows vista 64 bit operating system. Geografikos is a large project created as a masters thesis project by Jeremy Witmer. It is all coded in JRuby. I am currently expanding the project under his guidance however I cannot run his program. The following gems have been installed:
C:\work\Code\geografikos>jruby -S gem list
*** LOCAL GEMS ***
actionmailer (2.3.3)
actionpack (2.3.3)
activerecord (2.3.3)
activerecord-jdbc-adapter (0.9.1)
activerecord-jdbcmysql-adapter (0.9.1)
activeresource (2.3.3)
activesupport (2.3.3)
gchart (1.0.0)
google-geocode (1.2.1)
hoe (2.3.3)
hpricot (0.6.161)
jdbc-mysql (5.0.4)
jruby-openssl (0.5.1)
minitest (1.4.2)
nokogiri (1.3.3)
rack (1.0.0)
rails (2.3.3)
rake (0.8.7)
rc-rest (3.0.0)
rdoc (2.4.3)
rspec (1.2.6)
rubyforge (1.0.4)
rubygems-update (1.3.5)
sources (0.0.1)
geografikos.rb requires the following gems:
%w(rubygems digest/sha1 digest/md5 active_record hpricot yaml open-uri ostruct java google_geocode gchart active_record/fixtures).each{|f| require f}
I get the following error when I require or run geografikos.rb:
C:\work\Code\geografikos>jirb
irb(main):001:0> require 'geografikos'
LoadError: Could not open any of [xml2, xslt, exslt]
from C:/jruby-1.3.1/bin/../lib/ruby/1.8/ffi/library.rb:18:in `ffi_lib'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/nokogiri-1.3.3-java/lib/nokogiri/ffi/libxml.rb:5
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/nokogiri-1.3.3-java/lib/nokogiri/ffi/libxml.rb:31:in `require'
from C:/jruby-1.3.1/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:521:in `new_constants_in
'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/nokogiri-1.3.3-java/lib/nokogiri.rb:10
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/nokogiri-1.3.3-java/lib/nokogiri.rb:31:in `require'
from C:/jruby-1.3.1/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:521:in `new_constants_in
'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/rc-rest-3.0.0/lib/rc_rest.rb:3
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/rc-rest-3.0.0/lib/rc_rest.rb:31:in `require'
from C:/jruby-1.3.1/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:521:in `new_constants_in
'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google_geocode.rb:2
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/google-geocode-1.2.1/lib/google_geocode.rb:36:in `require'
from C:/jruby-1.3.1/bin/../lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:521:in `new_constants_in
'
from C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/activesupport-2.3.3/lib/active_support/dependencies.rb:156:in `require'
from geografikos.rb:304
from geografikos.rb:304:in `each'
from geografikos.rb:304
from geografikos.rb:2:in `require'
from (irb):2irb(main):002:0>
I have a feeling that I need to install the xml, xml2, xslt, and exslt libraries but I get an error when I attempt to install these which is shown below:
C:\work\Code\geografikos>jruby -S gem install libxml-ruby
Building native extensions. This could take a while...
ERROR: Error installing libxml-ruby:
ERROR: Failed to build gem native extension.
C:/jruby-1.3.1/bin/../bin/jruby.bat extconf.rb
C:/jruby-1.3.1/bin/../lib/ruby/1.8/mkmf.rb:7: JRuby does not support native extensions. Check wiki.jruby.org for alternatives. (No
tImplementedError)
from C:/jruby-1.3.1/bin/../lib/ruby/1.8/mkmf.rb:14:in `require'
from extconf.rb:14
Gem files will remain installed in C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.3 for inspection.
Results logged to C:/jruby-1.3.1/lib/ruby/gems/1.8/gems/libxml-ruby-1.1.3/ext/libxml/gem_make.out
Please let me know if you need any other information. I cannot solve this problem!
It appears that those gems are implemented "natively"; that is, in a low-level language rather than directly in Ruby. JRuby does not support gems with native extensions because it can't run them in the JVM.