bundle uses wrong ruby version
Running the command below helped me somehow: rbenv exec gem install bundler
Running the command below helped me somehow: rbenv exec gem install bundler
not sure if you got an answer to this, but I thought I’d offer what I did and it seemed to work. So once you get rbenv installed, and you use it to install a specific ruby version, you can install multiple versions of rails to for that ruby. STEP 1. Install whatever version(s) of … Read more
Did you add the following lines to your ~/.bash_profile? export PATH=”$HOME/.rbenv/bin:$PATH” eval “$(rbenv init -)” See: https://github.com/sstephenson/rbenv#installation
In order to make installing of Ruby versions 2.6.x or 2.7.x successful on M1 MacBook using either rbenv or asdf (asdf is used in this example) follow these steps: Upgrade to the latest version of rbenv or asdf-ruby plugin using your prefered installation method. In my case it’s asdf-ruby installed over homebrew: brew upgrade asdf … Read more
I’ve found a solution to load rbenv. Either with a loader importing rbenv to the PATH : */1 * * * * /bin/bash -c ‘. $HOME/.rbenv/loader.sh ; cd /data/app/; ruby -v’ The ‘.’ before ‘$HOME/.rbenv/loader.sh’ is important, it runs the script in the current shell Or without loader, which is better : */1 * * … Read more
After installing a gem via the command line in a ruby version you have to execute rbenv rehash as described in the docs here and here For example: $ rbenv install 2.2.0 $ gem install bundler $ rbenv rehash $ gem install rails $ rbenv rehash
Both rbenv and ruby-build are generally installed from Github by cloning; That’s how the authors recommend we install it. git clone https://github.com/sstephenson/rbenv.git ~/.rbenv git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build If you didn’t do it that way I’d recommend that method. Then, you can simply do: cd ~/.rbenv git pull cd plugins/ruby-build git pull If you have several … Read more
Most people solve this by installing the rails gem first via gem install rails. If you refuse to do that for some reason, you can opt out of the automatic bundling that Rails attempts to do for you. This will work completely regardless of your ruby management system. mkdir myapp cd myapp echo “source :rubygems” … Read more
Simple solution (directly installs latest stable version): rbenv install $(rbenv install -l | grep -v – | tail -1) Explanation: rbenv install -l | grep -v – | tail -1 Filters out all versions that contain a hyphen -, which is all non-MRI versions and prerelease MRI versions. Then selects the last one, guaranteed to … Read more
I was having the same issue. One hint was that rbenv exec bundle exec command worked and that rbenv exec bundle install –path vendor/bundle worked, but their prefixed equivalents failed. I wiped my ~/.rbenv, ~/.gem Gemfile.lock and vendor/bundle a few times trying to start fresh. Once these were cleaned away I tried the following: rbenv … Read more