0

When I've cloned my project from GitHub to another OSX computer with these versions:

$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-darwin13]
$ rails -v
Rails 4.2.1
$ rvm -v
rvm 1.26.10 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]

And use bundle install, then bin/rails server to run a local test environment, I get:

<rubyjedi>/lib/soap/rpc/httpserver.rb:21:in `<module:RPC>': uninitialized constant Logger::Application (NameError)
    from <rubyjedi>/lib/soap/rpc/httpserver.rb:18:in `<module:SOAP>'

I've replaced the full path ~/.rvm/gems/ruby-2.2.0/gems/rubyjedi-soap4r-1.5.8.20100619003610 with <rubyjedi> for readability.

Endless amounts of Googling tells me that a require 'logger' is missing from the problematic file, but the file already has that line:

require 'logger'
require 'soap/attrproxy'
require 'soap/rpc/soaplet'
require 'soap/streamHandler'
require 'webrick'

module SOAP
module RPC

class HTTPServer < Logger::Application
    # ...
end

Any insight as to what is causing this issue? I haven't gotten this issue on my first computer (also OSX, not with me currently.)

sjagr
  • 14,280
  • 4
  • 37
  • 63
  • Works on my machine. I use rbenv instead of rvm, so guess the problem lies in rvm. – Stobbej Mar 24 '15 at 16:42
  • @Stobbej Thanks for verifying, I'll implode rvm and try using rbenv instead. Trying to not get frustrated with Ruby/Rails environments while I'm still learning the whole thing lol – sjagr Mar 24 '15 at 16:48

2 Answers2

1

Ruby 2.2 dropped Logger::Application, so you now need to pull it in on your own. This answer is for closure for those who are hitting this issue on various gems, and are seeking a remedy.

In your Gemfile (if using Bundler), add a reference to logger-application gem

gem 'logger-application'

Then, in the problem code code, require logger-application just after requiring logger itself:

require 'logger'
require 'logger-application' unless defined?(Logger::Application)

BTW, since you are using my fork of Soap4R - check my github repo in a week, as I am in the middle of a major code refreshing effort on it. In addition to version-related fixes, you can look forward to faster XML processing options via Nokogiri and Ox Parsers.

Laurence A. Lee
  • 106
  • 1
  • 4
  • Great answer - definitely better than my "use something else" answer. I don't have any means to see if this would have solved my original problem so I have given you an upvote. – sjagr Jun 17 '15 at 13:44
0

The problem lies in the environment. With rvm there seems to be issues that I can't figure out, so removing rvm and then switching to rbenv fixes my troubles (assuming you already have Homebrew installed):

brew install rbenv ruby-build

# Add rbenv to bash so that it loads every time you open a terminal
echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
source ~/.bash_profile

# Install Ruby
rbenv install 2.2.1
rbenv global 2.2.1
# Verify Installation
ruby -v

# Install Rails
gem install rails -v 4.2.0
# Expose to bash
rbenv rehash
# Verify installation
rails -v
Community
  • 1
  • 1
sjagr
  • 14,280
  • 4
  • 37
  • 63