Tag: rubygems

在Ubuntu Server 12.04上安装Ruby gem“ffi”的问题

我正在尝试使用bundle来安装我的新项目所需的gem,但是我在安装’ffi’gem的1.1.5版本时遇到了麻烦。 我正在使用运行在64位Ubuntu Server 12.04的虚拟安装上的Ruby 1.9.3。 运行bundle命令时,收到以下错误消息: Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /home/alex/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb checking for ffi.h… no checking for ffi.h in /usr/local/include,/usr/include/ffi… no checking for rb_thread_blocking_region()… yes checking for ruby_native_thread_p()… yes checking for rb_thread_call_with_gvl()… yes creating extconf.h creating Makefile make Configuring libffi /gems/ffi-1.1.5/ext/ffi_c/libffi-x86_64-linux”SampleRails /gems/ffi-1.1.5/ext/ffi_c/libffi-x86_64-linux’ems/ruby-1.9.3-p194@SampleRails make “AR_FLAGS=” “CC_FOR_BUILD=” “CFLAGS=-Wall -fexceptions” “CXXFLAGS=” “CFLAGS_FOR_BUILD=” “CFLAGS_FOR_TARGET=” […]

错误的错误:未定义的方法`有?’ for Sass :: Util:Module

加载网页时,我收到Phusion发出的以下错误: There was an error while trying to load the gem ‘compass-rails’. Gem Load Error is: undefined method `has?’ for Sass::Util:Module Did you mean? hash Hash Backtrace for gem load error is: /Volumes/Data/htdocs/zetcho/vendor/bundle/gems/compass-0.12.2/lib/compass/sass_extensions/functions/urls.rb:5:in `has?’ 指定位置的代码是: module Compass::SassExtensions::Functions::Urls def self.has?(base, instance_method) Sass::Util.has?(:instance_method, base, instance_method) end 我的gem文件包含: # Bundle edge Rails instead: gem ‘rails’, github: ‘rails/rails’ gem […]

在轨道上的ruby中自动测试出错

我运行命令autotest,这是我得到的错误。 我正在关注Hartl的书,并想知道这场冲突是否正在发生,因为rails现在附带ZenTest或其他东西? 我如何解决此错误。 我是RoR的新手 Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement [“= 1.8”] Invalid gemspec in [/Users//.rvm/gems/ruby-1.9.2-p320@twitclone/specifications/ZenTest-4.8.4.gemspec]: Illformed requirement [“= 1.8”] /Users//.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs’: Could not find ZenTest (>= 0) amongst [abstract-1.0.0, actionmailer-3.2.8, actionmailer-3.2.8.rc1, actionmailer-3.0.1, actionmailer-3.0.0, actionpack-3.2.8, actionpack-3.2.8.rc1, actionpack-3.0.1, actionpack-3.0.0, activemodel-3.2.8, activemodel-3.2.8.rc1, activemodel-3.0.1, activemodel-3.0.0, activerecord-3.2.8, activerecord-3.2.8.rc1, activerecord-3.0.1, activerecord-3.0.0, activeresource-3.2.8, activeresource-3.2.8.rc1, activeresource-3.0.1, activeresource-3.0.0, activesupport-3.2.8, activesupport-3.2.8.rc1, activesupport-3.0.1, activesupport-3.0.0, addressable-2.3.2, […]

Windows 7 x64上的Ruby on Rails SQLite问题

当我尝试使用Windows 7 x64使用此db配置执行db:create on sqlite database时 development: adapter: sqlite3 database: db/development.sqlite3 timeout: 5000 我明白了,有点好笑 unknown error C:/Ruby/lib/ruby/1.8/dl/import.rb:29:in `initialize’ C:/Ruby/lib/ruby/1.8/dl/import.rb:29:in `dlopen’ C:/Ruby/lib/ruby/1.8/dl/import.rb:29:in `dlload’ C:/Ruby/lib/ruby/1.8/dl/import.rb:27:in `each’ C:/Ruby/lib/ruby/1.8/dl/import.rb:27:in `dlload’ C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/driver/dl/api.rb:31 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’ C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’ C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require’ C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in’ C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require’ C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/driver/dl/driver.rb:1 C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’ C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require’ C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require’ C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in’ C:/Ruby/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require’ C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/database.rb:619:in `load_driver’ C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/database.rb:617:in `each’ C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/database.rb:617:in `load_driver’ C:/Ruby/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.5-x86-mswin32/lib/sqlite3/database.rb:72:in […]

Capistrano是否需要在Gemfile的开发组中?

在一个rails Gemfile中,gem’capistrano gem ‘capistrano’是否需要位于:development组中,或者将它放在任意组中是否有任何优势,例如:tools ?

为什么我在environment.rb中需要这个gem时遇到错误?

我按照这里的步骤安装了composite_primary_keys gem。 当我尝试在文件的最底部(在’结束’之后)的环境中的environment.rb中要求gem require ‘composite_primary_keys’ 启动服务器时我得到了这个 “69125” => Booting Mongrel => Rails 2.3.4 application starting on http://127.0.0.1:3002 /Library/Ruby/Site/1.8/rubygems.rb:270:in `activate’: You have a nil object when you didn’t expect it! (NoMethodError) You might have expected an instance of Array. The error occurred while evaluating nil.map from /Library/Ruby/Site/1.8/rubygems.rb:296:in `activate’ from /Library/Ruby/Site/1.8/rubygems.rb:295:in `each’ from /Library/Ruby/Site/1.8/rubygems.rb:295:in `activate’ from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:35:in […]

捆绑更新失败:编组数据太短

$ bundle update Fetching gem metadata from http://rubygems.org/..Unfortunately, a fatal error has occurred. Please see the Bundler troubleshooting documentation at http://bit.ly/bundler-issues. Thanks! /Users/macbook/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/fetcher.rb:168:in `load’: marshal data too short (ArgumentError) from /Users/macbook/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/fetcher.rb:168:in `fetch_dependency_remote_specs’ from /Users/macbook/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/fetcher.rb:125:in `fetch_remote_specs’ from /Users/macbook/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/fetcher.rb:128:in `fetch_remote_specs’ from /Users/macbook/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/fetcher.rb:73:in `specs’ from /Users/macbook/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/source.rb:234:in `block in remote_specs’ from /Users/macbook/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/source.rb:232:in `each’ from /Users/macbook/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/source.rb:232:in `remote_specs’ from /Users/macbook/.rvm/gems/ruby-1.9.3-p374@global/gems/bundler-1.2.3/lib/bundler/source.rb:165:in `fetch_specs’ […]

安装geoip_city gem时出错

我在尝试安装geoip_city gem时遇到错误。 我已经将GeoIP C库安装到/ opt / GeoIP,但是gem似乎没有把它拿起来。 我试过了: sudo gem install geoip_city — –with-geoip-dir=/opt/GeoIP sudo gem install geoip_city — –with-geoip-lib=/opt/GeoIP/lib sudo gem install geoip_city — –with-geoip-dir=/opt/GeoIP –with-geoip-lib=/opt/GeoIP/lib 所有这些输出此错误: Building native extensions. This could take a while… ERROR: Error installing geoip_city: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb –with-geoip-lib=/opt/GeoIP/lib checking for GeoIP_record_by_ipnum() in -lGeoIP… […]

在gem中扩展rails模型

我想扩展我的rails应用程序中定义的模型调用配置。 出于某些建筑原因,如果我可以在gem中扩展它将会很棒。 但是在我的gem foo.rb文件中,如果我调用我的配置类: Configuration.class_eval do … end 它给我这个错误: configuration: undefined method ‘config’ for nil:NilClass (NoMethodError) 如果我试过这个: class Configuration TEST = [:foo, :foo2].freeze end 我无法访问我的rails应用程序中定义的activerecord类。 有没有办法重载gem中的某些rails类? 编辑:像这样的工作:) module m module ConfigurationExtension extend ActiveSupport::Concern included do CONSTAZ = [:foo].freeze end module ClassMethods def foo1 “foo1” end end module InstanceMethods def foo2 “foo2” end end end end […]

heroku语言区域设置不工作I18n :: MissingTranslationData

在我的本地电脑上一切正常,但在heroku我得到一个错误。 我的heroku控制台: PC@HOME-PC /c/rails/konkurranceportalen (master) $ heroku console Ruby console for vinderhimlen.heroku.com >> I18n.l Time.now I18n::MissingTranslationData: translation missing: da.time.formats.default /app/.bundle/gems/ruby/1.9.1/gems/i18n-0.5.0/lib/i18n/backend/fallbacks. rb:53:in `translate’ /app/.bundle/gems/ruby/1.9.1/gems/i18n-0.5.0/lib/i18n.rb:155:in `transla te’ /app/.bundle/gems/ruby/1.9.1/gems/i18n-0.5.0/lib/i18n/backend/base.rb:55 :in `localize’ /app/.bundle/gems/ruby/1.9.1/gems/i18n-0.5.0/lib/i18n.rb:235:in `localiz e’ PC@HOME-PC /c/rails/konkurranceportalen (master) $ heroku stack aspen-mri-1.8.6 bamboo-ree-1.8.7 * bamboo-mri-1.9.2 PC@HOME-PC /c/rails/konkurranceportalen (master) $