有没有人能够获得ruby 1.8.7,rails 2.3.x在osx mavericks上使用rvm?

时间:2013-12-02 16:56:22

标签: ruby-on-rails ruby rvm osx-mavericks

我刚刚从狮子升级到小牛队(似乎没有任何方式可以去山狮)。我有许多旧的铁轨项目,不同的红宝石和导轨版本。在狮子座上,我能够在红宝石1.8.7,1.9.2和1.9.2中正常工作,并在它们之间切换得很好。 1.8.7是系统ruby所以它不是真正的rvm,所以我做了rvm使用系统来使用它。

当我升级系统时,env变成了ruby 2,所以我尝试安装ruby 1.87并遇到了大量问题。

我最终爆炸了几次rvm以解决所有问题,但似乎仍然无法使我的1.8.7环境完全正常工作。我有几个需要本机编译的宝石。

我的最新一期是:in `require': no such file to load -- iconv (LoadError) 但是这些解决方案都不适合我。

我想知道我是否是唯一一个陷入这种情况的人,我找不到任何指南可以让这一切工作......有什么建议吗?

这是我当前的堆栈跟踪:

/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

2 个答案:

答案 0 :(得分:1)

这听起来像是通过自制软件或macports编译软件包的非常旧的安装,其中大部分都可以正常工作,但很少有人可能只使用以前系统中可用的库,现在就可以破解。

  1. 删除Homebrew尝试删除/usr/local - 如果您还安装了其他软件,这可能会很危险。
  2. 删除MAcports尝试删除/opt/local,这应该是安全的。
  3. 删除rvm
  4. 确保不强制任何环境变量或编译标志,rvm将检测所有内容并仅使用所需的标志,手动标志/ env变量只能混淆过程
  5. 从头开始安装它,它应该可以工作。

答案 1 :(得分:0)

好的,我做了mpapis的建议并消灭了rvm& amp;酿造,但我的一些酿造必须留下,所以我需要做: 酿造医生 然后 brew tap --repair homebrew / dupes

然后rvm install 1.8.7

在尝试获取服务器时,我遇到了以下问题:

<强>问题

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

解决方法:

rvm rubygems latest-1.8

<强>问题

/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

解决方法:

$ rvm @global
$ gem uninstall bundler.

<强>问题:

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

解决方法:

gem install rake --version 0.8.7

rvm @global

gem uninstall rake --version 10.0.3