I got a Rails project that uses Ruby 2.5.3 and I can run bin/rake --tasks from the terminal just fine:
$ rbenv version
# 2.5.3 (set by /Users/me/myproject/.ruby-version)
However, I get a message each time RubyMine telling me that rake --tasks can't be executed.
This is more of a nuisance than a real problem but I still want to get this fixed.
Interestingly, a different rubyframework 2.6.0 is used and it is the "native" ruby rather than one of my rbenv installations:
Error:[rake --tasks] /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.0.2) required by your /Users/besi/Dropbox/projects/boexli/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.0.2`
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
from /usr/bin/bundle:23:in `<main>'
Error:[rake --prereqs] /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.0.2) required by your /Users/besi/Dropbox/projects/boexli/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.0.2`
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
from /usr/bin/bundle:23:in `<main>'
I think, if I could change that framework 2.6 to my default 2.5.3 the issue would be resolved, but I can't seem to find that setting.
The SDK from which that task is executed does not show up the SDK Dialog at all.
Related
Newbie, I'm trying to run a first time cron job in Rails 7 with whenever gem. I get the following error in the cron.log:
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': Could not find 'bundler' (2.4.3) required by your /Users/myname/mysite/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:2.4.3`
from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in `activate_bin_path'
from /usr/bin/bundle:23:in `<main>'
I have this sample.rake:
namespace :sample do
desc "saying hi to cron"
task test: :developement do
puts 'hi cron'
end
end
And this schedule.rb:
set :output, "log/cron.log"
every 1.minute do
rake 'sample:test'
end
gem list | grep bundle
bundler (2.4.3)
bundler -v
Bundler version 2.4.3
I have run 'bundle update --bundler` but it does nothing.
I have updated Homebrew, it does nothing.
any help?
Unfortunately, an unexpected error occurred, and Bundler cannot continue.
First, try this link to see if there are any existing issue reports for this error:
https://github.com/rubygems/rubygems/search?q=wrong+number+of+arguments+%28given+4%2C+expected+1%29&type=Issues
If there aren't any reports for this error yet, please fill in the new issue form located at https://github.com/rubygems/rubygems/issues/new?labels=Bundler&template=bundler-related-issue.md, and copy and paste the report template above in there.
I try to run 'bundle install' and I get this error. I am trying to run specs for a school project testing me on Ruby on Rails associations among other things. The project uses pSQL, Ruby and RoR. I am able to run 'bundle install && ./setup_db.sh' in the active_record_queries folder but not in the associations folder for that is where I receive the above comment. When I run just 'bundle install' I receive: Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
I also need to run ./setup_db.sh after as stated in the read me.
Why am I getting this error message?
/rails1_practice
├── README.md (<- you are here)
├── active_record_queries
| └── README.md
├── associations
| └── README.md
├── migrations
| └── README.md
├── sql
| └── README.md
ace#ace-ThinkPad-T460:/$ rake about rake aborted! No Rakefile found
(looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
ace#ace-ThinkPad-T460:/$ rake about rake aborted! No Rakefile found
(looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
(See full trace by running task with --trace) ace#ace-ThinkPad-T460:/$
rails -v Rails 7.0.2.2 ace#ace-ThinkPad-T460:/$ ruby -v ruby 3.1.1p18
(2022-02-18 revision 53f5fc4236) [x86_64-linux]
ace#ace-ThinkPad-T460:/$ rbenv -v rbenv 1.2.0-11-ge4f61e6
ace#ace-ThinkPad-T460:/$ gem -v
3.3.7
'''
ace#ace-ThinkPad-T460:~/Desktop/codes/exactly!/rails1-practice/associations$ ./setup_db.sh
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
Your RubyGems version (2.7.6)) has a bug that prevents required_ruby_version from working for Bundler. Any scripts that use gem install bundler will break as soon as Bundler drops support for your Ruby version. Please upgrade RubyGems to avoid future breakage and silence this warning by running gem update --system 3.2.3
Could not find gem 'rails (>= 5.2.4.1, ~> 5.2.4)' in locally installed gems.
Run bundle install to install missing gems.
ace#ace-ThinkPad-T460:~/Desktop/codes/exactly!/rails1-practice/associations$ gem update --systemn 3.2.3
Failed to load /home/ace/.gemrc, wrong number of arguments (given 2, expected 1)
ERROR: While executing gem ... (OptionParser::InvalidOption)
invalid option: --systemn
ace#ace-ThinkPad-T460:~/Desktop/codes/exactly!/rails1-practice/associations$ gem update system
Failed to load /home/ace/.gemrc, wrong number of arguments (given 2, expected 1)
Updating installed gems
Nothing to update
'''
I want to upgrade from Rails 4.2 to 6. I have updated my Gemfile to include
fail "run 'gem install bundler' to update your bundler version" unless Bundler::VERSION >= '2.0.0'
source 'https://rubygems.org'
ruby '~> 2.7.1'
gem 'rails', '~> 6.0.0'
But attempting to upgrade the rails gem results in
$ bundle update rails
Traceback (most recent call last):
4: from /Users/myusername/.rvm/gems/ruby-2.7.1/bin/ruby_executable_hooks:22:in `<main>'
3: from /Users/myusername/.rvm/gems/ruby-2.7.1/bin/ruby_executable_hooks:22:in `eval'
2: from /Users/myusername/.rvm/gems/ruby-2.7.1/bin/bundle:23:in `<main>'
1: from /Users/myusername/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
/Users/myusername/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (1.17.3) required by your /Users/myusername/myrailsapp/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.3`
When I try and update the bundler, I get
$ bundle update --bundler
Fetching https://github.com/mimemagicrb/mimemagic.git
Fetching gem metadata from https://rubygems.org/.......
You have requested:
rails ~> 6.0.0
The bundle currently has rails locked at 4.2.10.
Try running `bundle update rails`
If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`
And as you might expect, running “bundle update” also results in an error …
$ bundle update
Traceback (most recent call last):
4: from /Users/myusername/.rvm/gems/ruby-2.7.1/bin/ruby_executable_hooks:22:in `<main>'
3: from /Users/myusername/.rvm/gems/ruby-2.7.1/bin/ruby_executable_hooks:22:in `eval'
2: from /Users/myusername/.rvm/gems/ruby-2.7.1/bin/bundle:23:in `<main>'
1: from /Users/myusername/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
/Users/myusername/.rvm/rubies/ruby-2.7.1/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (1.17.3) required by your /Users/myusername/myrailsapp/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.3`
Not sure where else to go from here.
I am getting this error while trying to push my app to heroku:
Warning: the running version of Bundler (1.17.2) is older than the version that created the lockfile (1.17.3). We suggest you upgrade to the latest version of Bundler by runninggem install bundler. I have the following versions of bundler:
gem list | grep bundler
bundler (2.0.2, default: 1.17.3, 1.17.2)
I have tried various suggestions from different similar posts but I am not able to set the bundler version to 1.17.2 which is required by Heroku. I tried:
gem uninstall bundler
gem install bundler -v 1.17.2
1 gem installed
Then removed the lock file and rerunning the bundle update but the version 1.17.3 still comes as the default.
I tried gem uninstall bundler:1.17.3 which returned:
Successfully uninstalled bundler-1.17.3
Then: gem install bundler -v 1.17.2which returned:
Successfully installed bundler-1.17.2
1 gem installed
Now bundler -v returns a LoadError:
Traceback (most recent call last):
3: from /home/amairu/.rvm/gems/ruby-2.6.1#rails522/bin/ruby_executable_hooks:24:in `<main>'
2: from /home/amairu/.rvm/gems/ruby-2.6.1#rails522/bin/ruby_executable_hooks:24:in `eval'
1: from /home/amairu/.rvm/gems/ruby-2.6.1#rails522/bin/bundler:23:in `<main>'
/home/amairu/.rvm/gems/ruby-2.6.1#rails522/bin/bundler:23:in `load': cannot load such file -- /home/amairu/.rvm/rubies/ruby-2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/exe/bundler (LoadError)
I am using rvm and I also tried to uninstall in the global gem set:
rvm use 2.6.1#global
gem uninstall bundler:1.17.3 which does not return any output or message.
How can I set the bundler to 1.17.2?
set your bundler version as a default version like below if you want to use 2.0.2
bundle _2.0.2_ -v
I had troubles with bundlers recently (Bundler v2.0.2 was installed, v1.17.3 set as default) but with a different error (Can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException)).
Running gem update --system did a trick for me.
Install the correct bundler for your application with the following command:
gem install bundler -v "$(grep -A 1 "BUNDLED WITH" Gemfile.lock | tail -n 1)"
I am trying to install bundler using ruby gems and RVM, but I am running into this error when I run the bundle init command:
/Library/Ruby/Site/2.0.0/rubygems/dependency.rb:315:in `to_specs': Could not find 'bundler' (>= 0) among 13 total gem(s) (Gem::LoadError)
Checked in 'GEM_PATH=/Users/CalebKleveter/.rvm/gems/ruby-2.2.3:/Users/CalebKleveter/.rvm/gems/ruby-2.2.3#global', execute `gem env` for more information
from /Library/Ruby/Site/2.0.0/rubygems/dependency.rb:324:in `to_spec'
from /Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_gem.rb:64:in `gem'
from /Users/CalebKleveter/.gem/ruby/2.0.0/bin/bundle:22:in `<main>'
I am installing it using this command:
gem install --user-install bundler
I was having issues before when downloading bundler. I was getting this error:
WARNING: You don't have /Users/CalebKleveter/.gem/ruby/2.2.0/bin in your PATH,
gem executables will not run.
So I ran this command to fix it:
PATH=$PATH:/Users/CalebKleveter/.gem/ruby/2.2.0/bin export PATH
Am I installing it in the wrong spot?
All gems were working earlier, but I ran this command:
rvm use 2.2.3
So I am using ruby version 2.2.3, I was using version 2.0.0 before if I remember correctly. Is that the issue?
It's not an issue per se, but you might find incompatibilities between old gems and current version of rails.
Run rvm list and then set the default to the latest version of rails and update your gems.