简体   繁体   English

Mac OSX 10.10 Yosemite-耙中止了! LoadError:无法加载此类文件— iconv

[英]Mac OSX 10.10 Yosemite - Rake aborted! LoadError: cannot load such file — iconv

It seems that my ruby version auto updated to 2.0.0 after I upgraded my OSX to Yosemite. 在将OSX升级到优胜美地之后,我的红宝石版本似乎自动更新为2.0.0。

It failed me when I tried to do 当我尝试做的时候我失败了

rake db:migrate

My application supports version 1.9.3 and I am uncertain that is the cause of such error. 我的应用程序支持1.9.3版,但我不确定这是导致此错误的原因。

$ rake db:migrate --trace
rake aborted! LoadError: cannot load such file -- iconv
/Users/jinqyu/Documents/Chocolicious/config/application.rb:5:in `require'
/Users/jinqyu/Documents/Chocolicious/config/application.rb:5:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/jinqyu/Documents/Chocolicious/Rakefile:4:in `<top (required)>'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/rake_module.rb:28:in `load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:687:in `raw_load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:94:in `block in load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:93:in `load_rakefile'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:77:in `block in run'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Library/Ruby/Gems/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/usr/bin/rake:37:in `<main>'

I found few links installing ruby 1.9.3 but I don't know which one to use. 我发现很少有安装ruby 1.9.3的链接,但是我不知道该使用哪个链接。 I followed a guide from http://www.curvve.com/blog/guides/2013/install-ruby-1-9-3-mac-osx-10-8-macports-rvm/ 我遵循了http://www.curvve.com/blog/guides/2013/install-ruby-1-9-3-mac-osx-10-8-macports-rvm/中的指南

However, I can't even run the first command 但是,我什至无法运行第一个命令

$sudo port selfupdate -v 

after installing macPort. 安装macPort之后。 It says command not found. 它说找不到命令。

Any ror warriors has the same problem as me and had solved it? 有没有一个ror战士和我有同样的问题并且已经解决了? Please help! 请帮忙!

Downgraded ruby version to 1.9.3 and the app works fine! 将Ruby版本降级到1.9.3,该应用程序运行良好! HOORAY! 万岁! So apparently the version is the cause of such error. 因此,显然版本是导致此类错误的原因。

Here's the steps I took to resolve the error, open your terminal. 这是我为解决错误而采取的步骤,请打开您的终端。

  1. Install RVM with a Ruby, copy & paste: 使用Ruby安装RVM,复制并粘贴:

     $ \\curl -sSL https://get.rvm.io | bash -s stable $ rvm get head 
  2. Install Ruby 安装Ruby

     $ rvm use --install 1.9.3 
  3. Bundle install & rake:db 捆绑安装&rake:db

     $ bundle install $ rake db:migrate 

Tell me if it solves your problem. 告诉我是否可以解决您的问题。 I might missed out some steps after trying many other solutions that I found online. 在尝试我在网上找到的许多其他解决方案之后,我可能会错过一些步骤。 p/s: you might have to install homebrew beforehand. p / s:您可能需要事先安装自制软件。 cheers! 干杯! :) :)

source: https://github.com/wayneeseguin/rvm/issues/3099 来源: https : //github.com/wayneeseguin/rvm/issues/3099

In order to resolve it, please add the following gem in the gem file, it would help you from being downgraded. 为了解决该问题,请在gem文件中添加以下gem,这将有助于您降级。

gem "iconv", "~> 1.0.3" 宝石“ iconv”,“〜> 1.0.3”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM