未定义的方法`end_with?' for“no file to load - Win32API”:String(NoMethodError) [英] Undefined method `end_with?' for "no such file to load -- Win32API":String (NoMethodError)
问题描述
我只是建立了一个新的服务器,想安装Twitter gem,但是遇到了Ubuntu 8.04 / Ruby 1.8.6的问题。
multi_json需要RubyGems> = 1.3.6,但运行gem update --system显然会尝试并更新到RubyGems 1.5,这是Ruby 1.8.6无法完成的,并且会失败并显示以下错误: 未定义的方法`end_with?'为没有要加载的文件 - Win32API:String(NoMethodError)
from ./lib/rubygems/config_file.rb:55
from ./lib/rubygems/custom_require.rb:29:in'gem_original_require'
from ./lib/rubygems/custom_require.rb:29:in 'require'
...
有什么想法?
谢谢
Steve
升级文档提到您可以使用以下命令来降级宝石。只需说它可能适用于升级到特定版本:
gem update --system 1.3.7 $ c $根据我刚刚收到的评论,你也可以尝试安装一个更老的宝石。
cd / usr / src&& wget http://production.cf.rubygems.org/rubygems/rubygems- 1.3.7.tgz
tar -xvf rubygems-1.3.7.tgz
ruby setup.rb
I'm just setting up a new server and want to install the Twitter gem but am running into problems on Ubuntu 8.04/Ruby 1.8.6
It says that "multi_json requires RubyGems >= 1.3.6", but running "gem update --system" obviously tries and updates to RubyGems 1.5 which can't be done on Ruby 1.8.6 and fails with the following error:
undefined method `end_with?' for "no such file to load -- Win32API":String (NoMethodError)
from ./lib/rubygems/config_file.rb:55
from ./lib/rubygems/custom_require.rb:29:in 'gem_original_require'
from ./lib/rubygems/custom_require.rb:29:in 'require'
...
Any ideas?
Thanks
Steve
The upgrade documentation mentions that you can use the following command to downgrade the gems. Suffice to say that it probably works for upgrading to a specific version as well:
gem update --system 1.3.7
In the light of the comment I just received you could also try to install an older gem your self.
For example (using root / sudo):
cd /usr/src && wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
tar -xvf rubygems-1.3.7.tgz
ruby setup.rb
这篇关于未定义的方法`end_with?' for“no file to load - Win32API”:String(NoMethodError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!