2

I just upgraded to mavericks, directly from lion (there didn't seem to be any way to go to mountain lion). I have many old rails projects with different ruby & rails versions. On lion I was able to work fine in ruby 1.8.7, 1.9.2 and 1.9.2 and switch nicely between them. 1.8.7 was the system ruby so it wasn't really in rvm, so I did rvm use system to use it.

When I upgraded my system env became ruby 2, so I tried to install ruby 1.87 and ran into tons of problems.

I ended up imploding my rvm several times to work through all the issues but still cant seem to get my 1.8.7 environment fully working. I have several gems that require native compilation.

My latest issue is this: in `require': no such file to load -- iconv (LoadError) but none of the solutions work for me.

I am wondering if maybe I am the only one stuck in such a situation, I cant find any guides out there to get this all working...Any suggestions?

Here is my current stack trace:

/usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `gem_original_require': no such file to load -- iconv (LoadError)
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/activesupport-2.3.5/lib/active_support/inflector.rb:3
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/activesupport-2.3.5/lib/active_support/core_ext/integer/inflections.rb:1
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/activesupport-2.3.5/lib/active_support/core_ext/integer.rb:2
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/activesupport-2.3.5/lib/active_support/core_ext.rb:8
from /usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/activesupport-2.3.5/lib/active_support/core_ext.rb:8:in `each'
from /usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/activesupport-2.3.5/lib/active_support/core_ext.rb:8
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/activesupport-2.3.5/lib/active_support.rb:55
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `require'
from /usr/local/rvm/gems/ruby-1.8.7-p374@global/gems/rails-2.3.5/lib/commands/server.rb:1
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `gem_original_require'
from /usr/local/rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/core_ext/kernel_require.rb:53:in `require'
from script/server:4
Community
  • 1
  • 1
Joelio
  • 4,621
  • 6
  • 44
  • 80
  • I had some problems at start, I had to install some C libraries but I don't remember which ones, I will take a look – sites Dec 03 '13 at 06:57
  • `rvm autolibs rvm_pkg` was one of them I think... could you please paste error trace, I remember I googled it and it appeared – sites Dec 03 '13 at 06:59

2 Answers2

1

This sounds like very old installation of compiled packages via homebrew or macports, most of them would just work but few might have used libraries available only in previous system and right now can just break.

  1. to remove Homebrew try removing /usr/local - this could be dangerous if you have other software installed in there too.
  2. to remove MAcports try removing /opt/local, this should be safe.
  3. remove rvm
  4. make sure to not force any environment variables or compilation flags, rvm will detect everything and use only needed flags, manual flags/env variables can only confuse the process

Install it all from scratch and it should work.

mpapis
  • 52,729
  • 14
  • 121
  • 158
  • I have imploded rvm, I dont have macports, I also updated homebrew and ran doctor and it seems good, also installed several of the brew items. Do you have this setup working, what versions of rubygems and rvm do you have? – Joelio Dec 03 '13 at 14:31
  • you need to remove all software installed with homebrew (there might be smaller subset, but you would be never sure if it is all), upgrading homebrew only upgrades homebrew code, it does not rebuild all the already installed software – mpapis Dec 03 '13 at 15:36
  • that would take an entire day, not a good solution, there has to be a way to get the list of stuff I would need to remove and reinstall without doing it all, many things work fine on brew, and I had to install several new things when trying to fight through various problems – Joelio Dec 05 '13 at 19:31
  • you could test each library manually, but that would take more then a day... unless you already know how to do that and have a handy script. – mpapis Dec 05 '13 at 21:49
  • ok I removed brew, and rvm and reinstalled both, tried to do rvm install 1.8.7 and get this error: Error: No available formula for gcc46 – Joelio Dec 06 '13 at 15:20
  • I googled around and found this: brew tap --repair homebrew/dupes, it fixed the error above – Joelio Dec 06 '13 at 15:54
  • I am giving mpapis credit because that was the issue, but to resolve it took quite a bit of other things, so I am posting my answer as well so others can see what I had to do. – Joelio Dec 06 '13 at 17:00
0

Ok, I did what mpapis suggested and wiped out rvm & brew, but some of my brew must have been left behind, so I needed to do : brew doctor then brew tap --repair homebrew/dupes

then rvm install 1.8.7

In trying to get my server, I ran into the problems below:

Problem:

undefined method `source_index' for Gem:Module (NoMethodError)

Work around:

rvm rubygems latest-1.8

Problem:

/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `setup': undefined method `name' for #<Array:0x1093b8328> (NoMethodError)
    from /Users/joelnylund/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `map'
    from /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `each'
    from /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `map'
    from /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `setup'
    from /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:114:in `check'
    from /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:121
    from /Users/joelnylund/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:34:in `gem_original_require'
    from /Users/joelnylund/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:34:in `require'
    from /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems_executable_plugin.rb:4
    from /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:50:in `call'
    from /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:50:in `run'
    from /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:49:in `each'
    from /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:49:in `run'
    from /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374/bin/ruby_executable_hooks:10

Work around:

$ rvm @global
$ gem uninstall bundler.

Problem:

The following gems have native components that need to be built
  zipruby  

You're running:
  ruby 1.8.7.374 at /Users/joelnylund/.rvm/rubies/ruby-1.8.7-p374/bin/ruby
  rubygems 1.4.2 at /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374, /Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global

Run `rake gems:build` to build the unbuilt gems.


Run rake gems:build and get error:
rake gems:build --trace
rake aborted!
ERROR: 'rake/rdoctask' is obsolete and no longer supported. Use 'rdoc/task' (available in RDoc 2.4.2+) instead.
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rake-10.1.0/lib/rake/rdoctask.rb:2
/Users/joelnylund/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `gem_original_require'
/Users/joelnylund/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:29:in `require'
/Users/joelnylund/Projects/socialsnap/Rakefile:8
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load'
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rake-10.1.0/lib/rake/rake_module.rb:25:in `load_rakefile'
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rake-10.1.0/lib/rake/application.rb:637:in `raw_load_rakefile'
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rake-10.1.0/lib/rake/application.rb:94:in `load_rakefile'
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rake-10.1.0/lib/rake/application.rb:93:in `load_rakefile'
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rake-10.1.0/lib/rake/application.rb:77:in `run'
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rake-10.1.0/lib/rake/application.rb:165:in `standard_exception_handling'
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rake-10.1.0/lib/rake/application.rb:75:in `run'
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/gems/rake-10.1.0/bin/rake:33
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/bin/rake:23:in `load'
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374@global/bin/rake:23
/Users/joelnylund/.rvm/gems/ruby-1.8.7-p374/bin/ruby_executable_hooks:15

Workaround:

gem install rake --version 0.8.7

rvm @global

gem uninstall rake --version 10.0.3
Joelio
  • 4,621
  • 6
  • 44
  • 80