Coder Social home page Coder Social logo

rails4_upgrade's Introduction

rails4_upgrade Build Status

Helps you more easily upgrade to Rails 4. A work in progress, I'm simply shipping something of a minimum viable product to attract others to contribute.

Inspired by rails_upgrade which helped upgrade applications from Rails 2 to Rails 3.

Written in part to complement the book Upgrading to Rails 4.

Installation

Upgrade to Ruby 1.9.3 if your application does not already use it. Rails 4 requires Ruby 1.9.3, and rails4_upgrade uses 1.9-only syntax and semantics.

Add to Gemfile:

gem 'rails4_upgrade', github: 'alindeman/rails4_upgrade'

Usage

Run rake rails4:check:

$ rake rails4:check

** GEM COMPATIBILITY CHECK **
+--------------------+----------------------+
| Dependency Path    | Rails Requirement    |
+--------------------+----------------------+
| draper 0.18.0      | actionpack ~> 3.2    |
| draper 0.18.0      | activesupport ~> 3.2 |
| simple_form 2.0.4  | actionpack ~> 3.0    |
| simple_form 2.0.4  | activemodel ~> 3.0   |
+--------------------+----------------------+

Contributing

I'm open to accepting pull requests that improve the functionality of the gem.

If there's an upgrade procedure that can be automated or semi-automated, let's discuss it. Open an issue.

Ideas:

  • Recommending versions of gems that may be compatible with Rails 4
  • Removing deprecated configuration options
  • Adding newly required or recommended configuration options

rails4_upgrade's People

Contributors

alindeman avatar rbgrouleff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rails4_upgrade's Issues

cannot load such file rubygems/util

I am on a Mac:
High Sierra 10.13
zsh
.rbenv
ruby 1.9.3-p448
rails 3.2.12

I get the following both with bundle exec and without

rake aborted!
cannot load such file -- rubygems/util
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in block in require'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in load_dependency' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/unicode-display_width-1.3.2/lib/unicode/display_width/index.rb:1:in <top (required)>' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/unicode-display_width-1.3.2/lib/unicode/display_width.rb:2:in require_relative'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/unicode-display_width-1.3.2/lib/unicode/display_width.rb:2:in <top (required)>' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in block in require' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in load_dependency'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/terminal-table-1.8.0/lib/terminal-table/cell.rb:1:in <top (required)>'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in block in require'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in load_dependency' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/terminal-table-1.8.0/lib/terminal-table.rb:25:in block in <top (required)>' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/terminal-table-1.8.0/lib/terminal-table.rb:24:in each'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/terminal-table-1.8.0/lib/terminal-table.rb:24:in <top (required)>' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in block in require' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in load_dependency'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require' /Users/tmb/msm/food-pantry-manager/vendor/bundle/bundler/gems/rails4_upgrade-2e39e8e55507/lib/rails4_upgrade/formatters/incompatible_gems_formatter.rb:1:in <top (required)>'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in block in require'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in load_dependency' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/bundler/gems/rails4_upgrade-2e39e8e55507/lib/rails4_upgrade/formatters.rb:1:in <top (required)>' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in block in require' /Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:236:in load_dependency'
/Users/tmb/msm/food-pantry-manager/vendor/bundle/gems/activesupport-3.2.12/lib/active_support/dependencies.rb:251:in require' /Users/tmb/msm/food-pantry-manager/vendor/bundle/bundler/gems/rails4_upgrade-2e39e8e55507/lib/rails4_upgrade.rb:4:in <top (required)>'
/Users/tmb/msm/food-pantry-manager/config/application.rb:14:in <top (required)>' /Users/tmb/msm/food-pantry-manager/Rakefile:5:in require'
/Users/tmb/msm/food-pantry-manager/Rakefile:5:in `<top (required)>'
(See full trace by running task with --trace)

stack level too deep on windows

Hi, I use Ruby 2.0 and Rails 4.0.0.beta1 on Windows 7, and I try to upgrade one of my 3.2.13 app to version 4. I found your tool but I get stack level too deep error message. Hope this helps for you.

$ rake rails4:check --trace
DL is deprecated, please use Fiddle
** Invoke rails4:check (first_time)
** Execute rails4:check
** GEM COMPATIBILITY CHECK **
** Invoke rails4:check_gems (first_time)
** Execute rails4:check_gems
rake aborted!
stack level too deep
c:/dev/Ruby200/lib/ruby/gems/2.0.0/gems/rake-10.0.4/lib/rake/task.rb:188
Tasks: TOP => rails4:check_gems

Have a nice day!

Scan files for deprecated code

Similar to the original rails_upgrade gem, have the rails4_upgrade gem scan files looking for potential known deprecations.

rake rails4:check raise NoMethodError: undefined method name for Array

Hi, I just tried this gem for the first time and I got a NoMethodError: undefined method name for #<Array:0x005590f01ba248> when running rake rails4:check.

I noticed that the spec of the gemfile.rb is a Bundler::LazySpecification. Is that right?

Should I have to do something different?

Thank you very much for your time on help me with this =)

More information:

ruby --version
ruby 2.2.7p470 (2017-03-28 revision 58194) [x86_64-linux]

rails --version
Rails 3.2.22.4

rake task unknown

be rake rails4:check
Resque::Helpers will be gone with no replacement in Resque 2.0.0.
Resque::Helpers will be gone with no replacement in Resque 2.0.0.
DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release notes for more on this: http://weblog.rubyonrails.org/2012/1/4/rails-3-2-0-rc2-has-been-released. (called from <top (required)> at /Users/andriytyurnikov/Code/curriculet/server/Rakefile:7)
rake aborted!
Don't know how to build task 'rails4:check'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.