Tag: gem

使用Mac OSX 10.6为Ruby on Rails安装mysql2 gem

我在安装mysql2 gem时遇到问题。 当我做gem install mysql2 : Marks-MacBook-Pro:~ Mark$ gem install mysql2 Building native extensions. This could take a while… ERROR: Error installing mysql2: ERROR: Failed to build gem native extension. /Users/useruser/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb checking for rb_thread_blocking_region()… yes checking for mysql_query() in -lmysqlclient… no checking for main() in -lm… yes checking for mysql_query() in -lmysqlclient… no checking […]

无法使用Windows在rails中安装JSON gem

我正在进行捆绑安装,所有的Gems工作正常,除了JSON,当它到达JSON gem我收到此错误。 Installing json (1.6.1) with native extensions c:/Ruby192/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:55 2:in `rescue in block in build_extensions’: ERROR: Failed to build gem native extension. (Gem::Installer::E xtensionBuildError) c:/Ruby192/bin/ruby.exe extconf.rb checking for re.h… *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. […]

Ruby gem用于查找位置的时区

我有一个位置(城市,州),日期和时间,我想将其转换为utc,但需要先找到该位置的时区。 我做了一些研究,一切似乎都指向地球工具或地理名称,但两个网络服务似乎只是纬度和经度。 是否有服务或gem或任何其他方式根据这种位置格式找到时区? 或者如何将位置转换为纬度和经度?

gem安装错误(sass指南针)

当我想安装sass和指南针时,我收到了这条消息。 有人能帮我吗? Microsoft Windows [version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. Tous droits réservés. C:\Users\Bk>gem install sass ERROR: While executing gem (Encoding::UndefinedConversionError) U+2019 to CP850 in conversion from UTF-16LE to UTF-8 to CP850

无法在OS X上安装mysql gem

我正在做 sudo gem install mysql 在OS X上安装mysql gem。 这失败,输出如下: 构建原生扩展。 这可能需要一段时间…… 错误:安装mysql时出错: 错误:无法构建gem原生扩展。 /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 检查mysql_ssl_set()…是的 检查rb_str_set_len()…是的 检查rb_thread_start_timer()…没有 检查mysql.h …是的 创建Makefile 使“DESTDIR =”干净 制作“DESTDIR =” 编译mysql.c 链接共享对象mysql / mysql_api.bundle clang:错误:未知参数:’ – multiply_definedsuppress'[-Wunused-command-line-> argument-hard-error-in-future] clang:注意:将来这将是一个很难的错误(不能降级为警告) make: * [mysql_api.bundle]错误1 失败,退出代码2 Gem文件将保留在/Library/Ruby/Gems/2.0.0/gems/mysql-2.9.1中以供检查。 结果记录到/Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/mysql-2.9.1/gem_make.out 什么可能导致这个? 我有自制的mysql安装,如果这有所作为。

如何在没有sudo的情况下安装gem

在我所有的gem安装上,我必须做sudo? 所以 sudo gem install rails 只会工作 gem安装导轨 不管用。 我该如何解决这个问题? 我安装了rvm – murtaza@murtaza-dev:~$ which rvm /home/murtaza/.rvm/bin/rvm murtaza@murtaza-dev:~$ which gem /home/murtaza/.rvm/rubies/ruby-1.9.3-p194/bin/gem 但是,当我使用gem进行任何操作时,我也会收到此警告 – murtaza@murtaza-dev:~$ gem /home/murtaza/.rvm/rubies/ruby-1.9.3-p194/bin/gem:4: warning: Insecure world writable dir /opt in PATH, mode 040777 编辑 我已经使用curl -L get.rvm.io | bash -s stable –auto重新安装了rvm curl -L get.rvm.io | bash -s stable –auto (没有sudo)。 但是,当我尝试安装gem时,它会给我以下错误 – […]

无法从rubygems.org安装’cocoapods’gem(错误的响应后端读取错误)

当我在OSX Mavericks上运行’gem install cocoapods’时出现错误。 $ gem install cocoapods ERROR: Could not find a valid gem ‘cocoapods’ (>= 0), here is why: Unable to download data from https://rubygems.org/ – bad response backend read error 503 (https://rubygems.global.ssl.fastly.net/quick/Marshal.4.8/cocoapods-0.27.1.gemspec.rz) ERROR: Possible alternatives: cocoapods 请注意,我可以直接下载cocoapods-0.27.1.gemspec.rz。 我正在运行最新版本的XCode(5.0.1)和最新版本的CLI工具。 RVM还配置为运行最新的Ruby版本(2.0.0p247)

Ruby 1.8.7(或Rails 2.x)中的String.force_encoding()

有没有在Ruby 1.8.7(或Rails 2.x)中使用String.force_encoding()的解决方案,以便它像在Ruby 1.9中一样工作? 我读了一些关于require active_support ,但这不起作用 $> gem list –local | grep’rails \ | activesupport’ activesupport (3.0.3, 2.3.8, 2.3.5) rails (2.3.8, 2.3.5) $> ruby -v ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-darwin10.4.0] $> rails -v Rails 2.3.8 IRB: > require “rubygems” => true > require “active_support” => true > “asdf”.force_encoding(“UTF-8”) NoMethodError: undefined method `force_encoding’ for […]

Ruby 1.9.2如何在Windows上安装RMagick?

我目前正在升级旧的rails应用程序以使用Rails 3和Ruby 1.9.2,而RMagick是我需要安装的最后一个gem。 但是,Windows似乎没有任何1.9.2下载,标准的gem安装RMagick也不起作用。 有人能指出我如何安装这个gem的正确方向吗?

sqlite3 gem无法安装

我正在尝试在OS X 10.6上安装“sqlite3-ruby”gem(或“sqlite3”gem)。 我正在使用ruby-1.9.2,目前我得到以下内容: $ sqlite3 –version 3.7.4 $ sudo gem install sqlite3 Building native extensions. This could take a while… ERROR: Error installing sqlite3-ruby: ERROR: Failed to build gem native extension. /Users/folken/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb checking for sqlite3.h… *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or […]