Skip to content
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 tasks errors with Bundler #3021

Closed
mdesantis opened this issue Jan 4, 2019 · 1 comment · Fixed by #3022
Closed

Rake tasks errors with Bundler #3021

mdesantis opened this issue Jan 4, 2019 · 1 comment · Fixed by #3022
Labels
type:bug Error, flaw or fault

Comments

@mdesantis
Copy link
Contributor

mdesantis commented Jan 4, 2019

Bundler 2.0 has been released some days ago. not related to Bundler version The Rakefile uses the Bundler constant for some tasks (e.g. rake sandbox) but it doesn't require bundler, causing such tasks to fail with the following error:

$ rake sandbox --trace
** Invoke sandbox (first_time)
** Execute sandbox
rake aborted!
NameError: uninitialized constant Bundler
/home/maurizio/Sviluppo/Nebulab/solidus/Rakefile:108:in `block in <top (required)>'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `block in execute'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `each'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:273:in `execute'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:214:in `block in invoke_with_call_chain'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/2.6.0/monitor.rb:230:in `mon_synchronize'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:194:in `invoke_with_call_chain'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/task.rb:183:in `invoke'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:160:in `invoke_task'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `each'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:116:in `block in top_level'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:125:in `run_with_threads'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:110:in `top_level'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:83:in `block in run'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:186:in `standard_exception_handling'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/lib/rake/application.rb:80:in `run'
/home/maurizio/.asdf/installs/ruby/2.6.0/lib/ruby/gems/2.6.0/gems/rake-12.3.2/exe/rake:27:in `<top (required)>'
/home/maurizio/.asdf/installs/ruby/2.6.0/bin/rake:23:in `load'
/home/maurizio/.asdf/installs/ruby/2.6.0/bin/rake:23:in `<main>'
Tasks: TOP => sandbox

Steps to reproduce

gem install bundler -v '2.0.1'
rake sandbox

Expected behavior

The task should successfully complete

Actual behavior

The task fails showing the error above

System configuration

Solidus Version: 2.8.0.alpha / 942ec5c

Extensions in use: none

@kennyadsl
Copy link
Member

This is not related to Bundler 2.0 but to not running the command with bundle exec. The proposed fix is still needed though.

@mdesantis mdesantis changed the title Rake tasks errors with Bundler 2.0 Rake tasks errors with Bundler Jan 4, 2019
mdesantis added a commit to mdesantis/solidus that referenced this issue Jan 4, 2019
Closes solidusio#3021. It fixes an error related to the Rakefile, where rake
tasks which use `Bundler` constant, such as `rake sandbox`, fail if
`bundler` is not explicitly required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Error, flaw or fault
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants