Can't bundle install after cloning repo - ruby-on-rails

Here's my error when I bundle. What's the problem?
bundle install
rbenv: bundle: command not found
The `bundle' command exists in these Ruby versions:
2.3.1
command -v ruby
/home/brian/.rbenv/shims/ruby
command -v bundle
/home/brian/.rbenv/shims/bundle
ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-linux]
bundle -v
Bundler version 1.15.3

Try:
Set correct ruby (rbenv) version rbenv global 2.3.1
And then rbenv rehash and then bundle install.
If that won't work I think you should reinstall bundler
Once again set correct ruby version rbenv global 2.3.1
gem uninstall bundler
gem install bundler
And then rbenv rehash and then bundle install.

Related

How to fix 'Your Ruby version is 2.3.3, but your Gemfile specified 2.5.2'

I got an error: Your Ruby version is 2.3.3, but your Gemfile specified 2.5.2 with running bundle install.
Besides, ruby -v shows ruby 2.5.2p104 (2018-10-18 revision 65133) [x86_64-linux].
OS: Debian 9
Problem with bundler was solved with: Your Ruby version is 2.0.0, but your Gemfile specified 2.1.0
But now there is the same error with rails s
The problem was solved by,
rvm reinstall ruby-2.5.2
rvm default use ruby-2.5.2
bundle install
bin/rails s

Bundle install not using rbenv local Ruby version

I am trying to install gems for a new Rails project using bundler:
$ bundle install --path
I've set my local Ruby version to 2.3.1 using rbenv, but bundler is still using my system Ruby (2.0.0).
$ rbenv local
2.3.1
$ echo $PATH
/Users/jenniferpierce/.rbenv/shims:/Users/jenniferpierce/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/PostgreSQL/9.5/bin
$ which ruby
/Users/jenniferpierce/.rbenv/shims/ruby
$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
$ bundle install --path
Your Ruby version is 2.0.0, but your Gemfile specified 2.3.1
My bash profile includes:
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
I've run:
$ rbenv rehash
and restarted my terminal. Maybe I'm missing something super obvious? Any ideas would be appreciated.
To add to this, in my case, I first had to run rbenv rehash and then install the bundler gem, and then re-run bundle install. Without all of those steps, it kept the same old Ruby version.
You should be able to just run bundle install without the --path. I believe --path allows you to specify a different path than the one in your system, but if you modified your bash profile as you suggested, there is no need for that.
Also, if you just changed your ruby version for the local folder, you should run a gem install bundler.

Your Ruby version is 2.2.4, but your Gemfile specified 2.3.0?

I'm trying to bundle install a ruby project in Git Bash but I'm getting the above message.
ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [i836-mingw32]
gem -v
2.3.0
New to Ruby so its really frustrating. I'm trying to do the project below
http://www.viralrails.com/?p=25
This happens because you are specifying a Ruby version in your Gemfile (2.3.0) and this version is not installed or is not the current or default version.
Don't remove the line ruby '2.3.0' as someone said above. You app may have dependencies to this version. Do the following:
1) Check if you have Ruby 2.3.0 installed. If you are using rvm this may be done by
rvm list
and if you are using rbenv by
rbenv versions
2) If you don't have this Ruby version in your list of installed versions, then install it by issuing the following command
rvm install 2.3.0
and if you are using rbenv by
rbenv install 2.3.0
3) If you already had Ruby 2.3.0 installed or completed step 2 above, enter your app directory and issue the following command
rvm use 2.3.0
and if you are using rbenv by
rbenv local 2.3.0
Then run
bundle install
and I believe things will be ok.
Hope it helps!
Install bundler after installing ruby 2.4.0.
gem install bundler
If you installed bundler before installing ruby 2.4.0 then you should reinstall bundler or update it.
Also if the above command didn't work.
gem update bundler

Solidus gem showing error regarding ruby version during bundle install

I am trying to install Solidus gem which is a fork of spree and while running bundle install this shows up
Installing solidus_core 1.1.0
Gem::InstallError: solidus_core requires Ruby version >= 2.1.0.
An error occurred while installing solidus_core (1.1.0), and Bundler cannot
continue.
even when I am running ruby version 2.2.3
ruby -v
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15]
I am using rbenv on OS X El Capitan to control the ruby versions. Is there a problem with ruby version control or any other issue?
Try to set ruby '2.2.3' in Gemfile, and execute bundle install.
If it's not resolved, please check your bundle path to execute this:
$ which bundle
/usr/bin/bundle # global
$ gem install bundler
$ bundle install --path vendor/bundle

rbenv Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2 but the only version installed is 2.1.2

I'm using rbenv but I can run my server with: rails s
display me an error with:
Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2
I tried uninstall the version 2.0.0 but this version doesn't exist
rbenv unistall 2.0.0
And I tried with:
rvm implode
-bash: rvm: command not found
because I'm not using rvm, what I can do to run my server?
And my ruby build says:
$ ruby-build --version
ruby-build 20141113
You just need to install Ruby 2.1.2. You can have multiple Ruby versions installed at the same time. If you have ruby-build installed you can do the following: install 2.1.2, rehash your shims, and then tell rbenv to use 2.1.2 for this project.
rbenv install 2.1.2
rbenv rehash
rbenv local 2.1.2
You're going to have to gem install bundler and then bundle install on your project afterwards.

Resources