New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rake commands fail if using rails 5 #681

Closed
yltsrc opened this Issue Jun 28, 2015 · 30 comments

Comments

Projects
None yet
@yltsrc

yltsrc commented Jun 28, 2015

$ rake spec
rake aborted!
LoadError: cannot load such file -- rails/test_unit/sub_test_task
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/gems/draper-2.1.0/lib/draper/tasks/test.rake:7:in `require'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/gems/draper-2.1.0/lib/draper/tasks/test.rake:7:in `<top (required)>'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/gems/draper-2.1.0/lib/draper/railtie.rb:67:in `load'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/gems/draper-2.1.0/lib/draper/railtie.rb:67:in `block (2 levels) in <class:Railtie>'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/gems/draper-2.1.0/lib/draper/railtie.rb:67:in `each'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/gems/draper-2.1.0/lib/draper/railtie.rb:67:in `block in <class:Railtie>'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/bundler/gems/rails-1022796ac075/railties/lib/rails/railtie.rb:237:in `instance_exec'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/bundler/gems/rails-1022796ac075/railties/lib/rails/railtie.rb:237:in `block in run_tasks_blocks'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/bundler/gems/rails-1022796ac075/railties/lib/rails/railtie.rb:245:in `each'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/bundler/gems/rails-1022796ac075/railties/lib/rails/railtie.rb:245:in `each_registered_block'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/bundler/gems/rails-1022796ac075/railties/lib/rails/railtie.rb:237:in `run_tasks_blocks'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/bundler/gems/rails-1022796ac075/railties/lib/rails/application.rb:442:in `block in run_tasks_blocks'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/bundler/gems/rails-1022796ac075/railties/lib/rails/engine/railties.rb:13:in `each'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/bundler/gems/rails-1022796ac075/railties/lib/rails/engine/railties.rb:13:in `each'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/bundler/gems/rails-1022796ac075/railties/lib/rails/application.rb:442:in `run_tasks_blocks'
/home/vagrant/.rvm/gems/ruby-2.2.2@rails_5.0/bundler/gems/rails-1022796ac075/railties/lib/rails/engine.rb:460:in `load_tasks'
/home/vagrant/test_app/rakefile:7:in `<top (required)>'
(See full trace by running task with --trace)
@yltsrc

This comment has been minimized.

Show comment
Hide comment
@yltsrc

yltsrc Jun 28, 2015

example Gemfile

source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'sprockets-rails', github: 'rails/sprockets-rails'
gem 'arel', github: 'rails/arel'
gem 'sqlite3'
gem 'draper'
gem 'rspec-rails'

yltsrc commented Jun 28, 2015

example Gemfile

source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'sprockets-rails', github: 'rails/sprockets-rails'
gem 'arel', github: 'rails/arel'
gem 'sqlite3'
gem 'draper'
gem 'rspec-rails'
@audionerd

This comment has been minimized.

Show comment
Hide comment
@audionerd

audionerd Oct 8, 2015

In test.rake Draper requires rails/test_unit/sub_test_task, but Rails 5 does not have that file in railties/lib/rails/test_unit anymore.

It was removed by 3297909 (see also: 8017e6a).

audionerd commented Oct 8, 2015

In test.rake Draper requires rails/test_unit/sub_test_task, but Rails 5 does not have that file in railties/lib/rails/test_unit anymore.

It was removed by 3297909 (see also: 8017e6a).

audionerd added a commit to audionerd/draper that referenced this issue Oct 8, 2015

Setup test task in Rails 5 style
This bug was causing all rake tasks to fail in Rails 5 when draper gem was present
Fixes drapergem/draper#681
@asiniy

This comment has been minimized.

Show comment
Hide comment
@asiniy

asiniy Nov 7, 2015

@audionerd do you have any plans regarding send pull request of your 'rails5' branch to the master branch of this repo?

asiniy commented Nov 7, 2015

@audionerd do you have any plans regarding send pull request of your 'rails5' branch to the master branch of this repo?

@audionerd

This comment has been minimized.

Show comment
Hide comment
@audionerd

audionerd Nov 7, 2015

@asiniy No, sorry, I haven't had time to dig further into Rails 5 support for Draper. My current branch was just a quick hack that "worked for me", but I didn't do any further testing.

audionerd commented Nov 7, 2015

@asiniy No, sorry, I haven't had time to dig further into Rails 5 support for Draper. My current branch was just a quick hack that "worked for me", but I didn't do any further testing.

@mayank-istar

This comment has been minimized.

Show comment
Hide comment
@mayank-istar

mayank-istar Dec 24, 2015

can any one tell me how to resolve this error.

mayank-istar commented Dec 24, 2015

can any one tell me how to resolve this error.

@jasnow

This comment has been minimized.

Show comment
Hide comment
@jasnow

jasnow Dec 24, 2015

@mayank-istar - Try "gem 'draper', github: 'audionerd/draper', branch: 'rails5'"

jasnow commented Dec 24, 2015

@mayank-istar - Try "gem 'draper', github: 'audionerd/draper', branch: 'rails5'"

@seanlinsley

This comment has been minimized.

Show comment
Hide comment
@seanlinsley

seanlinsley Dec 24, 2015

Member

@audionerd are you planning on opening a pull request?

Member

seanlinsley commented Dec 24, 2015

@audionerd are you planning on opening a pull request?

@dmitry

This comment has been minimized.

Show comment
Hide comment
@dmitry

dmitry Dec 27, 2015

@audionerd would be great to see it get merged.

dmitry commented Dec 27, 2015

@audionerd would be great to see it get merged.

versify added a commit to versify/draper that referenced this issue Jan 23, 2016

Setup test task in Rails 5 style
This bug was causing all rake tasks to fail in Rails 5 when draper gem was present
Fixes drapergem#681
@ivanjolic95

This comment has been minimized.

Show comment
Hide comment
@ivanjolic95

ivanjolic95 Mar 22, 2016

I can't pull draper from github because I'm using it in an engine as a dependency. Are there any plans to add official Rails 5 support?

ivanjolic95 commented Mar 22, 2016

I can't pull draper from github because I'm using it in an engine as a dependency. Are there any plans to add official Rails 5 support?

@jasnow

This comment has been minimized.

Show comment
Hide comment
@jasnow

jasnow Mar 22, 2016

@ivanjolic95 : Did you try gem 'draper', github: 'audionerd/draper', branch: 'rails5' ?

jasnow commented Mar 22, 2016

@ivanjolic95 : Did you try gem 'draper', github: 'audionerd/draper', branch: 'rails5' ?

@ivanjolic95

This comment has been minimized.

Show comment
Hide comment
@ivanjolic95

ivanjolic95 Mar 22, 2016

I can't really use any fork because I cannot pull gems from github in engine's .gemspec file. I've tried to put it in the gemfile and it doesn't work.

ivanjolic95 commented Mar 22, 2016

I can't really use any fork because I cannot pull gems from github in engine's .gemspec file. I've tried to put it in the gemfile and it doesn't work.

@Mehonoshin

This comment has been minimized.

Show comment
Hide comment
@Mehonoshin

Mehonoshin Apr 6, 2016

Hi, folks!
I'm currently collecting all Rails 5 related fixes in single branch.
But we need an active maintainer to merge it and release new draper version.

Mehonoshin commented Apr 6, 2016

Hi, folks!
I'm currently collecting all Rails 5 related fixes in single branch.
But we need an active maintainer to merge it and release new draper version.

jwidderich added a commit to bichinger/draper that referenced this issue Apr 7, 2016

Mehonoshin added a commit to Mehonoshin/draper that referenced this issue Apr 13, 2016

Merge pull request #2 from bichinger/rails5-fix-test-dependency
Fix dependency on rails/test_unit/sub_test_task (drapergem#681)
@chulkilee

This comment has been minimized.

Show comment
Hide comment
@chulkilee

chulkilee May 18, 2016

Instead of using forked version of draper, you can do monkey patch like this:

# lib/rails/test_unit/sub_test_task.rb
class Rails::SubTestTask < Rake::TestTask
end

chulkilee commented May 18, 2016

Instead of using forked version of draper, you can do monkey patch like this:

# lib/rails/test_unit/sub_test_task.rb
class Rails::SubTestTask < Rake::TestTask
end
@JohnSmall

This comment has been minimized.

Show comment
Hide comment
@JohnSmall

JohnSmall Sep 22, 2016

How come this is tagged as Closed and Merged when it very clearly isn't?

I've just created a new Rails 5 project and get this exact error.

JohnSmall commented Sep 22, 2016

How come this is tagged as Closed and Merged when it very clearly isn't?

I've just created a new Rails 5 project and get this exact error.

@kyledecot

This comment has been minimized.

Show comment
Hide comment
@kyledecot

kyledecot Sep 29, 2016

My team is also receiving this error on various projects when attempting to move to Rails 5. Any progress on getting this fixed (without monkey patching)?

kyledecot commented Sep 29, 2016

My team is also receiving this error on various projects when attempting to move to Rails 5. Any progress on getting this fixed (without monkey patching)?

@danielricecodes

This comment has been minimized.

Show comment
Hide comment
@danielricecodes

danielricecodes Oct 10, 2016

@JohnSmall @kyledecot - same. Brand new Rails 5 project and just gem 'draper' in Gemfile. Using the fork seemed to work though.

danielricecodes commented Oct 10, 2016

@JohnSmall @kyledecot - same. Brand new Rails 5 project and just gem 'draper' in Gemfile. Using the fork seemed to work though.

@asiniy

This comment has been minimized.

Show comment
Hide comment
@asiniy

asiniy Oct 11, 2016

Guys, feel free to switch to the gem 'drape'. It's a draper designed for rails 5.

asiniy commented Oct 11, 2016

Guys, feel free to switch to the gem 'drape'. It's a draper designed for rails 5.

@dmitry

This comment has been minimized.

Show comment
Hide comment
@dmitry

dmitry Oct 11, 2016

@asiniy do you mean https://github.com/MrEmelianenko/drape? It's not developed for the last 5 months, how can anyone be sure it will be maintained in the future?

dmitry commented Oct 11, 2016

@asiniy do you mean https://github.com/MrEmelianenko/drape? It's not developed for the last 5 months, how can anyone be sure it will be maintained in the future?

@rafaelsales

This comment has been minimized.

Show comment
Hide comment
@rafaelsales

rafaelsales Dec 27, 2016

omg, that's lame.

rafaelsales commented Dec 27, 2016

omg, that's lame.

@keithmattix

This comment has been minimized.

Show comment
Hide comment
@keithmattix

keithmattix Jan 12, 2017

Still no solution for this? drape hasn't been updated in 8 months...

keithmattix commented Jan 12, 2017

Still no solution for this? drape hasn't been updated in 8 months...

@dmitry

This comment has been minimized.

Show comment
Hide comment
@dmitry

dmitry commented Jan 12, 2017

Checkout #772

@seanlinsley

This comment has been minimized.

Show comment
Hide comment
@seanlinsley

seanlinsley Jan 15, 2017

Member

Could someone please open a PR?

Member

seanlinsley commented Jan 15, 2017

Could someone please open a PR?

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Jan 26, 2017

So, the issue is 1,5 years old and there is still no fix for that? Except the monkey patch and forked repos, of course...

ghost commented Jan 26, 2017

So, the issue is 1,5 years old and there is still no fix for that? Except the monkey patch and forked repos, of course...

@MatthiasRMS

This comment has been minimized.

Show comment
Hide comment
@MatthiasRMS

MatthiasRMS Feb 2, 2017

For Rails 5 use:
gem 'draper', "3.0.0.pre1"

Not a fork and not a monkey patch. Seems to be the "best" solution right now.

MatthiasRMS commented Feb 2, 2017

For Rails 5 use:
gem 'draper', "3.0.0.pre1"

Not a fork and not a monkey patch. Seems to be the "best" solution right now.

@Irostovsky

This comment has been minimized.

Show comment
Hide comment
@Irostovsky

Irostovsky Feb 3, 2017

It works with rails 5, thank you @MatthiasRMS

Irostovsky commented Feb 3, 2017

It works with rails 5, thank you @MatthiasRMS

@sanchojaf

This comment has been minimized.

Show comment
Hide comment
@sanchojaf

sanchojaf Feb 21, 2017

Hi, same issue with gem 'rails', '~> 5.0.1'

And gem 'draper' is not working for me, I try master, rails5 branch, 3.0.0.pre1

sanchojaf commented Feb 21, 2017

Hi, same issue with gem 'rails', '~> 5.0.1'

And gem 'draper' is not working for me, I try master, rails5 branch, 3.0.0.pre1

@codebycliff codebycliff added this to the 3.0.0 milestone Mar 29, 2017

@codebycliff

This comment has been minimized.

Show comment
Hide comment
@codebycliff

codebycliff Mar 29, 2017

Collaborator

Is this still an issue in master?

Collaborator

codebycliff commented Mar 29, 2017

Is this still an issue in master?

@codebycliff

This comment has been minimized.

Show comment
Hide comment
@codebycliff

codebycliff Mar 31, 2017

Collaborator

I believe this is no longer an issue. Please correct me if I'm wrong and I'll take a look into it.

Collaborator

codebycliff commented Mar 31, 2017

I believe this is no longer an issue. Please correct me if I'm wrong and I'll take a look into it.

@kyledecot

This comment has been minimized.

Show comment
Hide comment
@kyledecot

kyledecot Apr 17, 2017

@codebycliff Is a new version going to be released on rubygems?

kyledecot commented Apr 17, 2017

@codebycliff Is a new version going to be released on rubygems?

@codebycliff

This comment has been minimized.

Show comment
Hide comment
@codebycliff

codebycliff Apr 17, 2017

Collaborator

@kyledecot Yes, soon.. I'm hoping to have a release in the next couple weeks.

Collaborator

codebycliff commented Apr 17, 2017

@kyledecot Yes, soon.. I'm hoping to have a release in the next couple weeks.

totem3 pushed a commit to totem3/draper that referenced this issue Jul 12, 2017

Setup test task in Rails 5 style
This bug was causing all rake tasks to fail in Rails 5 when draper gem was present
Fixes drapergem/draper#681
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment