【问题标题】:has anyone been able to get ruby 1.8.7 , rails 2.3.x working on rvm on osx mavericks?有没有人能够获得 ruby​​ 1.8.7,rails 2.3.x 在 osx 小牛队的 rvm 上工作?
【发布时间】:2013-12-02 16:56:21
【问题描述】:

我刚刚升级到小牛,直接从狮子(似乎没有任何办法去山狮)。我有许多具有不同 ruby​​ 和 rails 版本的旧 rails 项目。在 lion 上,我能够在 ruby​​ 1.8.7、1.9.2 和 1.9.2 中正常工作,并在它们之间很好地切换。 1.8.7 是系统 ruby​​,所以它不是真的在 rvm,所以我做了 rvm use system 来使用它。

当我升级我的系统环境变成了 ruby​​ 2,所以我尝试安装 ruby​​ 1.87 并遇到了很多问题。

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

我的最新一期是这样的: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

【问题讨论】:

  • 我一开始遇到了一些问题,我必须安装一些C库但我不记得哪些,我会看看
  • rvm autolibs rvm_pkg 是我认为的其中之一...你能粘贴错误跟踪吗,我记得我用谷歌搜索它并出现了

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


【解决方案1】:

这听起来像是通过 homebrew 或 macports 安装编译包的非常古老的方式,它们中的大多数都可以正常工作,但很少有人使用仅在以前的系统中可用的库,现在可能会崩溃。

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

从头开始安装它应该可以工作。

【讨论】:

  • 我已经内爆了 rvm,我没有 macports,我还更新了 homebrew 并运行了医生,看起来不错,还安装了几个 brew 项目。你有这个设置吗?你有什么版本的 ruby​​gems 和 rvm?
  • 您需要删除所有使用自制软件安装的软件(可能有较小的子集,但您永远不确定是否全部),升级自制软件只会升级自制软件代码,它不会重建所有已经已安装的软件
  • 这需要一整天,不是一个好的解决方案,必须有一种方法来获取我需要删除和重新安装的东西的列表,而不用做所有事情,很多事情在 brew 上都可以正常工作,并且在尝试解决各种问题时,我不得不安装一些新东西
  • 您可以手动测试每个库,但这需要一天以上的时间......除非您已经知道如何做到这一点并且有一个方便的脚本。
  • 好的,我删除了 brew 和 rvm 并重新安装了两者,尝试执行 rvm install 1.8.7 并收到此错误:错误:gcc46 没有可用的公式
【解决方案2】:

好的,我按照 mpapis 的建议执行了操作并清除了 rvm 和 brew,但我的一些 brew 肯定被遗忘了,所以我需要这样做: 冲泡医生 然后 brew tap --repair homebrew/dupes

然后 rvm 安装 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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-01
    • 1970-01-01
    • 2020-04-06
    • 2011-07-12
    • 1970-01-01
    相关资源
    最近更新 更多