Tag: gem

AWS框上的Unicorn工作人员超时

我正在尝试在AWS盒子上设置一个Unicorn,但是工作人员只是保持计时,我不知道为什么。 我正在使用Ubuntu Server 14.04 LTS AMI,安装标准Ruby on Rails安装所需的一切。 使用rails new,我生成一个空的应用程序,第一次尝试访问它似乎很快,但在此之后,工作人员只是持续超时并永远服务于网页。 加载标准WEBrick服务器没有这个问题,几乎立即加载页面。 我试过回滚几个版本的ruby和独角兽没有运气。 VM中本地不会发生此行为。 以下是在调试模式下运行的服务器的日志 我,[2014-11-04T18:30:13.290599#17134]信息 – :收听addr = 0.0.0.0:5000 fd = 10 I,[2014-11-04T18:30:13.362993#17134]信息 – :主过程就绪 I,[2014-11-04T18:30:13.363098#17137] INFO – :worker = 0 ready I,[2014-11-04T18:30:13.365175#17140] INFO – :worker = 1 ready I,[2014-11-04T18:30:13.365314#17142] INFO – :worker = 2 ready /var/lib/gems/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:443中的exception’LoadError’ – 无法加载此类文件 – rails / application_helper.rb /var/lib/gems/2.1.0/gems/activesupport-4.1.7/lib/active_support/dependencies.rb:352中的exception’LoadError’ – […]

使用ActiveAdmin的DSL与共享模块包括

我正在尝试为使用ActiveAdmin注册的模型进行一些常见/共享操作。 我有以下代码: # app/admin/concerns/activatable.rb module Activatable def self.included(dsl) dsl.member_action :deactivate, method: :put do dsl.resource.deactivate! redirect_to dsl.resource_path, notice: ‘Deactivated.’ end end end # app/admin/course.rb ActiveAdmin.register Course do include Activatable # … end 当我运行rails server ,服务器立即退出抛出以下内容: /Users/Doug/.rvm/gems/ruby-2.1.2/gems/activerecord-4.1.1/lib/active_record/ dynamic_matchers.rb:26:in `method_missing’: undefined method `member_action’ for # (NoMethodError) DSL似乎与我的course.rbfunctioncourse.rb ,其中来自activatable.rb的代码工作正常(尽管没有dsl.* )。 有任何想法吗?

无效的规范缓存文件

我在Windows 8上安装了带有Gem 2.2.2的ruby 2.0.0p247 [x64-mingw32]。我有一个持久性问题gem,使它几乎无法使用。 每当我尝试安装新gem时,我总会得到: ERROR: While executing gem … Invalid spec cache file in C:/Users/… 在过去,我已经能够运行gem update或gem update –system ,这将解决单个 gem install 。 后续安装将失败并出现相同的错误。 现在甚至gem更新失败并显示该错误消息。 我试过删除users/…/.gem目录。 当我这样做时, gem update重新创建该目录并立即失败,并显示相同的错误消息。 我用gem重新安装了ruby 1.9.8几次试图解决问题,然后升级到ruby 2.0.0。 在所有重新安装和升级过程中,问题仍然存在。 我在这里结束了我的智慧。 任何人都可以帮我解决这个问题吗? 这是编辑中的回溯“ L:\xampp\htdocs\frameworks\yii2\framework>gem update –backtrace Updating installed gems ERROR: While executing gem … (Gem::Exception) Invalid spec cache file in […]

Nokogiri本机扩展无法构建(不是libxml2或libxslt缺少问题)

正如标题所说,它似乎没有失败,因为缺少libxml2或libxslt。 我不确定该怎么做错误。 (得到它?因为问题出在制作期间?嘿嘿……) Anywho,这是我得到的输出。 任何想法,将不胜感激: Building native extensions. This could take a while… ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config. checking for libxml/parser.h… yes checking for libxslt/xslt.h… yes checking for libexslt/exslt.h… yes checking for iconv_open() in iconv.h… yes checking for […]

运行gem specific_install时出错

我正在尝试运行’gem specific_install’( https://github.com/rdp/specific_install )从Github存储库安装另一个gem: sudo gem specific_install https://github.com/RemoteRepository/foo_gem.git 在提示我的Github用户名和密码后,我可以下载gem。 但是,我收到以下错误: ERROR: While executing gem … (NoMethodError) undefined method `build’ for Gem::Package:Module 显然,其他人根据对这个问题的specific_install相关答案的评论有相同的错误: 如何从GitHub源安装gem? 如何解决这个错误?

在Yosemite 10.10.3上安装Nokogiri

我有: Mac OS X Yosemite 10.10.3 MacPorts(不是Brew) 系统中的Ruby 2(不是RVM) 我想安装Nokogiri并尝试: port install nokogiri 得到了: Building native extensions. This could take a while… ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20150323-30174-1mqhl4i.rb extconf.rb checking if the C compiler accepts … yes checking if the C compiler accepts -Wno-error=unused-command-line-argument-hard-error-in-future… no Building nokogiri […]

如何使用bundler创建相互依赖的gem,并使用存储库作为源?

如何创建相互依赖的gem,仍然使用Bundler? 现在,如果library-a Gemfile如下所示: gem ‘library-b’ gem ‘library-c’ 并且library-b的Gemfile读取如下: gem ‘library-a’ gem ‘library-c’ 并且library-c的Gemfile读取: gem ‘library-a’, github: ‘library-root/library-a’, branch: ‘master’ gem ‘library-b’, github: ‘library-root/library-b’, branch: ‘master’ 当您尝试为library-c运行bundle update和/或bundle install ,这是输出: Your Gemfile requires gems that depend depend on each other, creating an infinite loop. Please remove either gem ‘library-a’ or gem ‘library-b’ and try again. 对于library-a或library-b将发生相同消息的变体。 […]

Ruby:Rails:使用哪个版本的gem?

我有一个Rails 3应用程序,它在Gemfile中有以下行。 gem ‘sqlite3’, ‘1.3.6’ 但是,如果我列出我的本地gem,我得到: > gem list sqlite3 –local *** LOCAL GEMS *** sqlite3 (1.3.6, 1.3.4) 当我的Rails应用程序执行时 require ‘sqlite3’ 选择了哪个版本的gem? 是否选择了列表中的第一个gem? 有没有办法告诉Ruby运行时使用版本1.3.4,即使安装了1.3.6版本,并且Gemfile强制要求?

避免使用第三方gem是正确的吗?

我正在使用Ruby on Rails 3.2.2。 我想知道以下的想法(从我之前的问题出生)是否正确: 我倾向于不使用第三方gem(至少在可能和合理的情况下),因为它们可能随时被抛弃。 此外,如果Ruby on Rails框架发生变化,我可能需要等待更新这些gem才能将我的应用程序更新到最新的RoR版本。

CheckoutController#在哪里编辑疯狂?

我需要使用CheckoutController的edit操作,我在服务器日志中看到它,我在文档中看到它,但我在gem的代码中找不到它。 魔术在哪里? 狂欢版本是1.2.2