rails-3-upgrade

Upgrading Rails app from 3.2.6 to 3.2.8

本秂侑毒 提交于 2020-01-13 09:48:07
问题 I have a Rails app that was created using Rails 3.2.6 . Now that 3.2.8 has been released, is this all I need to do to update the app? Edit Gemfile , changing the line gem 'rails', '3.2.6' to gem 'rails', '3.2.8' Run bundle update rails What about other Rails-generated entries in the Gemfile , such as sass-rails , coffee-rails and uglifier ? 回答1: Hat tip to Santiago Pastorino (Rails Core Team Member), who confirmed this is all that's required: Edit Gemfile , changing the line gem 'rails', '3.2

Can not install rails 3.0 for Massive Record

妖精的绣舞 提交于 2020-01-06 08:45:13
问题 I am Trying to install rails 3.0 to use with Massive Record Gem. But when I am trying to install, the gem rails -v 3.0.0 is installed successfully. But, When I do rails -v it shows error : /home/mayukh/.rvm/gems/ruby-2.1.2@global/gems/rubygems-bundler-1.4.4/lib/rubygems-bundler/noexec.rb:84:in setup': undefined method rubygems' for Bundler:Module (NoMethodError) Please find the Ruby, Bundler details and error details below: 回答1: That's a really old bundler version that is compatible with

Gem dependency conflict between coffee-rails and rspec-rails

随声附和 提交于 2020-01-06 04:12:04
问题 I'm upgrading an app from rails 3.1.1 to rails 3.2. I had to update version of coffee-rails as well as rspec-rails to their latest versions to work with rails 3.2. However, they both seem to be incompatible with each other. When I run the bunder I get In Gemfile: coffee-rails (~> 3.2.2) ruby depends on actionpack (= 3.2.0) ruby rspec-rails (~> 2.8.1) ruby depends on actionpack (3.0.0) However, on rubygems for rspec-rails, it clearly specifies the dependency to be >= actionpack (3.0.0) Has

Custom filtering of parameters in rails 3 using config.filter_parameters

烈酒焚心 提交于 2019-12-30 05:06:07
问题 I'm working on upgrading from Rails 2.3.11 to 3.0.10, and am having trouble converting what is in the ApplicationController 's filter_parameter_logging . I want to filter both certain parameters, and also filter them if they appear in the value of something like a :referrer tag. I can get the regular parameters filtered out in my application.rb config.filter_parameters += [:password, :oauth, ...] But what I'm having trouble with is the block that we also pass in filter_parameter_logging. It

Downgrading a Rails 3 App to Rails 2

纵然是瞬间 提交于 2019-12-25 05:18:12
问题 I've run into a problem today. I've spent the past couple of months building a fairly intensive Rails 3 App that uses all the latest versions of every gem I need. I've just been informed that I can't use anything new. I'll be adding my project in with a bunch of others which use older versions of everything. We can't upgrade the existing, we can only downgrade mine. With that said, I need to downgrade pretty much everything I've done. Here's a list of what I'm using currently (via gem list ):

Upgrading ERb tags for Rails 3 upgrade. Should I: <%= end %> as well?

倾然丶 夕夏残阳落幕 提交于 2019-12-25 03:24:51
问题 Given a block of rails 2.3.x ERb code: <% form_for account, :url => { :action => :invite } do |f| %> # blah <% end %> using the Rails upgrade plugin, it tells me that I need to replace <% with <%= should I also do this for the end line? Such as: <%= form_for account, :url => { :action => :invite } do |f| %> # blah <%= end %> 回答1: No, you would only need <%= when you start a block. So it would be: <%= form_for account, :url => { :action => :invite } do |f| %> # blah <% end %> See this rails

Call to expire_fragment raises “ to use #url_for, you must include routing helpers explicitly” error

笑着哭i 提交于 2019-12-12 15:39:21
问题 I've been upgrading a Rails 2 app to Rails 3.2.13 and am having a problems when I try to enable caching. Caching worked in Rails 2 and I'm using the same version of Ruby - 1.8.7. I'm not sure if it is relevant but I'm developing on OSX. The error's being thrown from the ActionController::Caching::Fragments class when expire_fragment is called. expire_fragment makes a call to fragment_cache_key which contains this: ActiveSupport::Cache.expand_cache_key(key.is_a?(Hash) ? url_for(key).split("://

How to use polymorphic_path in a functional test in Rails 3

喜夏-厌秋 提交于 2019-12-10 15:54:25
问题 I'm trying to use polymorphic_path in a functional test in Rails 3. At first I would get NoMethodError: undefined method `polymorphic_path' for #<ArticlesControllerTest:0x492f17c> And then I added include Rails.application.routes.url_helpers The undefined method error stopped, but now regular paths, like article_path(article) for example stopped working: NameError: undefined local variable or method `default_url_options' for #<ArticlesControllerTest:0x33ccbe0> .rvm/gems/ruby-1.9.2-p290/gems

Rails 3: undefined method `remote_form_for'

偶尔善良 提交于 2019-12-10 12:53:03
问题 I have a fairly simple Rails remote form in HAML in a partial under shared/users: - remote_form_for :user, :url => { :controller => "users", :action => "create" } do |f| .field = f.label :name, t('name') = f.text_field :name .field = f.label :email, t('email') = f.text_field :email .actions = f.submit No matter how much I fiddle with it, this just won't work. I alway get the following error: undefined method `remote_form_for' for #<#<Class:0x1036e8e40>:0x1036dfd90> Am I doing something stupid

Upgrading Rails app from 3.2.6 to 3.2.8

与世无争的帅哥 提交于 2019-12-05 06:42:42
I have a Rails app that was created using Rails 3.2.6 . Now that 3.2.8 has been released, is this all I need to do to update the app? Edit Gemfile , changing the line gem 'rails', '3.2.6' to gem 'rails', '3.2.8' Run bundle update rails What about other Rails-generated entries in the Gemfile , such as sass-rails , coffee-rails and uglifier ? Hat tip to Santiago Pastorino (Rails Core Team Member), who confirmed this is all that's required: Edit Gemfile , changing the line gem 'rails', '3.2.6' to gem 'rails', '3.2.8' Run bundle update rails Confirmation tweet. After running $ bundle install , run