问题标签 [rails-3-upgrade]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
885 浏览

ruby-on-rails - rails 3 使用文件夹名称作为 namspace 引发未初始化的常量错误

我正在尝试将应用程序从 rails 2.3 升级到 3.0并且它有一个文件

其中包含

我相信Utility::Interface::Import是其文件路径中的文件夹名称,但用作名称空间

此代码在 rails 2.3 中运行良好,但是当我尝试使用 rails 3.0.6 运行时,它会抛出 NameError

仅供参考:rails 2.3 使用 ruby​​ 1.8.7,rails 3.0.6 使用 ruby​​ 1.9.2

如果我的理解不正确,请纠正我

0 投票
0 回答
188 浏览

ruby-on-rails - 将 rails 2.3 中的 activescaffold(不推荐使用的功能)升级到 3.0 升级

我正在尝试将应用程序从 rails 2.3 升级到 3.0,它使用 Active-scaffold 插件

在升级过程中,我删除了 Active-scaffold(兼容 rails 2.3 的插件)并安装了 gem active_scaffold-3.0.26

但我经常收到以下错误

似乎这些功能ui_type, live_search在新版本中已被弃用,但我找不到任何关于弃用函数替代品的适当文档

有关在 rails 3 中升级 ActiveScaffold 插件的任何信息

0 投票
2 回答
539 浏览

ruby-on-rails - rails 3 upgrade - 您在邮件程序类中使用旧 API

我正在尝试将应用程序从 rails 2.3 升级到 3.0.6

在rails 2.3中有以下代码

在升级过程中代码修改如下

通过参考这个关于在 rails 3.0 中使用 ActionMailer 的著名博客

最后运行rake rails:upgrade:check(检查 rails 3 不兼容的功能),它显示

(即)它说我仍在使用旧 API

有人可以解释我在这里缺少什么吗?

或者有没有其他方法可以消除“您在邮件类中使用旧 API”错误?

仅供参考:宝石已更新,环境为 ruby​​ 1.8.7,rails 3.0.6

0 投票
2 回答
234 浏览

ruby-on-rails - 在 Rails 3 中,哪些内容插入块助手改变了行为?

Rails 3.0的发行说明包括此更改:

7.4.2 带块的助手

form_for喜欢或div_for从块中插入内容的助手<%=现在使用:

您自己的此类助手应返回一个字符串,而不是手动附加到输出缓冲区。

做其他事情的助手,比如cacheor content_for,不受这种变化的影响,他们<%像以前一样需要。

我们正在将一个 Web 应用程序从 Rails 2.3.18 迁移到 Rails 3.1.12,拥有一个已更改的此类帮助程序的完整列表非常有用,这样我们就可以检查它们在我们的源代码,但我无法找到此类权威列表。

我尝试过查看rails 项目的 git 历史记录,但似乎有许多带有相关更改的提交,并且它们显然没有分组在特定的分支上。例如,这个列表包括:

  • form_for
  • form_tag
  • fields_for
  • field_set_tag

...从7b622786f

  • link_to

...在e98474096中提到,并且:

  • div_for
  • content_tag_for

...在e8d2f48cff中提到

  • remote_form_for

.... 在0982db91f中提到过,尽管它已在 Rails 3 中删除。

但是,我确定这并不完整——谁能提供完整的清单?

0 投票
1 回答
126 浏览

ruby-on-rails - Migrating from restful_authentication to Devise with Rails 2.3.14

I am in the process of using the rails upgrade plugin (https://github.com/rails/rails_upgrade) to bring the application from 2.3.14 to 3.2. The plugin identified "restful_authentication" as something that needed to be replaced. After some research I decided to try to migrate to Devise. I started looking at https://github.com/plataformatec/devise/wiki/How-To:-Migrate-from-restful_authentication-to-Devise, the issue I ran into is that these instructions are not meant for Rails 2.3.14. I can figure out how to make most of it work for 2.3.14, but the biggest block I have ran into is that I am not sure which versions of Devise, Devise-encryptable and other gems to use. Is there an simple way to check? Alliteratively am I making a mistake in trying to migrate to devise before I upgrade, should it be done the other way around?

0 投票
2 回答
674 浏览

ruby-on-rails-3 - 调用 expire_fragment 引发“使用 #url_for,您必须明确包含路由助手”错误

我一直在将 Rails 2 应用程序升级到 Rails 3.2.13,当我尝试启用缓存时遇到问题。缓存在 Rails 2 中工作,我使用的是相同版本的 Ruby - 1.8.7。我不确定它是否相关,但我正在 OSX 上开发。

调用 expire_fragment 时,从 ActionController::Caching::Fragments 类抛出错误。expire_fragment 调用 fragment_cache_key ,其中包含:

对 url_for 的调用引发了此错误

这是进一步延伸的回溯:

自然,我尝试在调用 expire_fragment 的类中包含 Rails.application.routes.url_helpers 但无济于事,因为错误来自 ActionController 模块。ActionController::Base 已经包含了 UrlFor 模块,所以我的问题是:为什么包含 UrlFor 的模块类会在应该能够使用 url_for 的情况下引发错误,要求包含 url_helpers?

0 投票
0 回答
44 浏览

ruby-on-rails - rails upgrade 3:没有方法错误

我刚刚将我的应用程序从 2.3.11 升级到 3.0.6。我想将它进一步升级到 rails 3.2。升级到 3.0.6 后,我收到此错误消息 https://github.com/kumarsaurabh20/PlotApp/blob/rails3/error_message.txt

我想不出一个可能的答案,为什么会出现这个没有方法错误?我该如何解决这个问题?我已经检查过以前的类似问题,但找不到适合我的案例的解决方案。

0 投票
1 回答
240 浏览

ruby-on-rails - Rails 升级错误 A secret is required to generate an integrity hash

所以我刚刚从 Ruby 1.8.7 升级到 1.9.3。然后从 rails 2.3.18 到 rails 3.0.20 但我遇到了这个错误

需要一个秘密来为 cookie 会话数据生成完整性哈希。在 config/initializers/secret_token.rb 中使用 config.secret_token = "some secret phrase of at least 30 characters"

我已经搜索并看到了所有关于这个的问题,说你需要添加

我在我的 config/initializers/secret_token.rb 中有这个。还有什么可以给我这个错误?

我也有:

在我的 config/initializers/session_store.rb

我相信我可能在升级过程中遗漏了导致此错误的某些内容?

编辑

我在 environment.rb 中错过了这个

现在它工作正常!

干杯

0 投票
1 回答
36 浏览

ruby-on-rails-3 - 从 Rails 3.0.0 升级到 Rails 4.0

很久以前,我在github 上的Rails_uprade插件的帮助下将我的 rails 项目从2.2.2升级到了3.0.0。现在我想将我的代码升级到 Rails 4,我正在寻找指导我的教程。

提前致谢!

0 投票
1 回答
906 浏览

ruby-on-rails-3 - Geokit - `block(2个级别)在': 未定义的方法

我正在将 Rails 2.3.8 应用程序迁移到 Rails 3.0.20,所以我从使用“gem'geokit'1.6.0”到“gem”geokit-rails。

我得到:

我的 geokit_config.rb 是:

当我删除 geokit_config.rb 文件时,服务器启动但我显然有:

任何想法?