Bundle fails to install better_errors.
Gem::InstallError: better_errors requires Ruby version >= 2.0.0.
An error occurred while installing better_errors (2.0.0), and Bundler cannot continue.
Make sure that `gem install better_errors -v '2.0.0'` succeeds before bundling.
But gem install better_errors
works fine.
ruby --version
says ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux-gnu]
. I already tried upgrading to 2.1 but still not working.
Any suggestions?
I had this same problem. In my case, the bundler script had
#!/usr/bin/ruby
as the initial line in the script. As a result, it was calling the system (non-rbenv) version, which was 1.9.1 (in Linux Mint)
It's pretty hacky but changing that first line by running
sudo nano /usr/local/bin/bundle
to the full path for the rbenv shim (in my case):
#!/home/$YOUR_USERNAME/.rbenv/shims/ruby
solved the problem.
Hi for all the people who have different versions of ruby in their machine, and even if
rvm use ruby-version
doesn't work.
Try this,
rvm list
this will specify all the ruby version in your machine.
rvm rubies
* ruby-1.9.3-p484 [ x86_64 ]
ruby-2.1.0-preview2 [ x86_64 ]
ruby-2.1.1 [ x86_64 ]
=> ruby-2.1.5 [ x86_64 ]
In your project root folder, just create a file
.ruby-version
and add the ruby version you are planning to use.
ruby-2.1.5
Thats it, restart your application and try reinstalling your gems. :)
If you use rvm, make sure you don't have an .rvmrc
file at the root of your project that force ruby < 2.0 to run, same with rbenv and .ruby-version
file
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With