我的应用是用Rails 2.3.11和Ruby 1.8.7p352开发的。
当我尝试运行'rake spec‘时,控制台中显示了很多不推荐使用的警告。
DEPRECATION WARNING: ActiveSupport::Dependencies.load_paths is deprecated, please use autoload_paths instead. (called from load_paths at /home/soundarapandian/.rvm/gems/ruby-1.8.7-p352/gems/desert-0.5.2/lib/desert/mana
我目前正在运行Redmine,在更新gem时,Phusion Passenger抛出了无法定位所需库的错误。它似乎一直在寻找更老的宝石,而不是更新的宝石。
在更新gem之后,我运行以下命令:
gem cleanup
移除所有不再需要的旧宝石。
不幸的是,尽管安装了较新的gem,但Phusion Passenger抛出了以下错误:
Could not find activesupport-3.2.11 in any of the sources (Bundler::GemNotFound)
但是,已经安装了activesupport-3.2.12。
为了暂时解决这个问题,我需要重新安装旧版本。不
你好,我是ruby和rails的新手。但是当我启动rail服务器时,我得到了这个错误
这就是我得到的错误
D:\mynewapp>ruby script/server
从D:/mynewapp/ => / WEBrick / _require': n such file to load -- rush (MissingSourceFile) from D:/ruby/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require' from D:/ruby/lib/
我见过类似的帖子,但我仍然不知道我的错误是从哪里来的
我的I18n每次需要用法语进行复数时都会失败。每次这是一个类似的错误:计数
示例:translation data {:one=>"est trop court (au moins un caractère)", :other=>"est trop court (au moins %{count} caractères)"} can not be used with :count => 2
像这样的翻译也会出现其他错误(总是在尝试复数的时候)。
datetime:
distance_in
我使用的是friendly_id 4.0.8和rails 3.0.1。我想使用历史记录功能。
当我键入命令rails generate friendly_id时,它失败了,并显示以下错误消息:
[WARNING] Could not load generator "generators/friendly_id_generator". Error: ActiveRecord is not missing constant Migration!.
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.1/lib/active_support/d
我想我已经按照这些设置好了
但是,当我试图在现有的应用程序中更新弹格列时,我的标签是这样的:
Tag.find_each(&:save)
我得到了一个错误:
NameError: uninitialized constant Tag
Tag不是正确的吗?
编辑:完全错误日志
ActsAsTaggableOn::Tag Load (0.8ms) SELECT "tags".* FROM "tags" ORDER BY "tags"."id" ASC LIMIT 1000
(0.2ms) BEGIN
当我在一个测试类中有多个测试时,我使用模块对测试进行分组。
因为我对rails非常陌生,我的问题是:
它是正确的方式分组测试,还是我正在做非常愚蠢的事情,而不知道其他副作用?
以下是代码:
require 'test_helper'
module AttributeValidationTest
extend ActiveSupport::Testing::Declarative
test "should not ...." do
# .....
end
# other tests here....
end
module Anoth
我在Github上的一个个人项目上收到了一个依赖警告,要求我Upgrade activesupport to version 6.0.3.1 or later.它建议我做一些类似gem "activesupport", ">= 6.0.3.1"的事情。我的问题是,我是否可以直接更新我的Gemfile.lock?或者,我是否将此行添加到我的Gemfile中,并让bundler更新Gemfile.lock
我感到困惑的一个原因是我的Gemfile目前没有对activesupport的引用,所以我不确定是否应该将这一行添加到Gemfile中。
我试图在可挂载的引擎中挂载rails活动管理gem,但在运行虚拟应用服务器时遇到以下错误--
/.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib/active_support/file_update_checker.rb:25:in `stat': No such file or directory - /mycode/testingengine/app/admin (Errno::ENOENT)
from /.rvm/gems/ruby-1.9.2-p290/gems/activesupport-3.1.1/lib
我已经为这个问题挣扎了好几天了。我有一个应用程序,我正在为它构建一些app,上面提到的错误总是在我的应用程序第一次运行时崩溃。这个错误在重新加载应用程序时消失了,但是它还是很烦人。以下是有关此错误的一些类似问题:
这两个链接并没有解决我面临的问题。下面是完整的堆栈跟踪:
ArgumentError (A copy of Api::V1 has been removed from the module tree but is still active!):
activesupport (5.1.4) lib/active_support/dependencies.rb:495:in `loa
我知道include用于访问模块方法作为实例方法,而extend用于访问模块方法作为类方法。
对于ActiveSupport::关注点在我看来是这样写的,
module Test
include ActiveSupport::Concern
end
有些地方写成,
module Test
extend ActiveSupport::Concern
end
在这里,我的困惑是,ActiveSupport::关注点应该与包含或扩展一起使用吗?
我尝试使用默认的活动管理电子邮件- admin@example.com和密码- password登录,但当我单击登录时,收到错误消息
`wrong number of arguments (2 for 1)`
# POST /resource/sign_in
def create
self.resource = warden.authenticate!(auth_options)
set_flash_message(:notice, :signed_in) if is_flashing_format?
sign_in(resource_name, reso
我目前正在使用rails 4.2.0和ruby2.3.0,并且正确地设置了一切。Ran rake db:迁移,捆绑安装,用正确的ssh键设置heroku,并将其推到heroku,但是它给了我这个错误列表,我不知道原因,也没有发现其他人发布了这个问题。有谁有主意吗?我在生产组的宝石档案里有pg。
remote: rake aborted!
remote: Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem
我正在将一个应用程序从Rails 3.2.11升级到3.2.17,并收到以下错误消息:
DEPRECATION WARNING: ActiveSupport::Memoizable is deprecated and will be removed in future releases, simply use Ruby memoization pattern instead.
我知道回忆录是什么,而冒犯的代码似乎如下:
def api
@client.vm_by_name(name) if cluster
end
memoize :api
我不太清楚如何用红宝石回忆录模式回忆录。以前的技术
可悲的是,下面的内容不起作用。时间不能respond_to(:format_to_my_datetime)。所以我的假设是,同一个文件中的细化不能相互使用。相反,在我定义ActiveSupport细化的地方,我需要在该文件中使用using TimeFormatter来细化该方法上下文中的时间。
但我有遗漏什么吗?除了在format_to_my_datetime上重新实现ActiveSupport (时区)之外,我还能在一个文件中完成所有这些工作吗?
module TimeFormatter
include MyFormats
refine String do
def form
我在亚马逊EC2 (Ubuntu10.10)上的Ruby on Rails应用程序运行正常,但在服务器上启动Ruby on Rails控制台时运行速度非常慢。启动Ruby on Rails控制台大约需要3到5分钟。使用,我可以看到进程占用了99%的时间。太慢了。为什么?
我使用的是Ruby 1.9.2p290和Ruby on Rails 3.1.1。我的Ruby on Rails gemfile.lock
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.1)
actionpack (= 3.1.1)