J'utilise donc rbenv pour définir ma version ruby (pour le projet spécifique sur lequel je travaille, c'est 2.1.1). Le problème est que bundler est incapable de détecter ce changement. J'ai même essayé de mettre la version dans mon Gemfile:Bundler avec le fichier pathfile version rbenv numéro
source "https://my-proxy-address"
ruby "2.1.1"
gem 'fileutils'
gem 'json'
gem 'chef-api'
Cependant, cela provoque le message d'erreur exact vu here à la fin du tutoriel:
[email protected]:~/Desktop/working-bundler-env$ rbenv version
2.1.1 (set by /Users/username/.rbenv/version)
[email protected]:~/Desktop/working-bundler-env$ ruby -v
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin15.0]
[email protected]:~/Desktop/working-bundler-env$ bundle install
Your Ruby version is 2.0.0, but your Gemfile specified 2.1.1
The tutorial a la solution à la question (éditer un fichier pathfile), cependant ils ne disent pas quel fichier changer. Quel fichier est-ce que je change?
$ rbenv
rbenv 1.0.0
Usage: rbenv <command> [<args>]
Some useful rbenv commands are:
commands List all available rbenv commands
local Set or show the local application-specific Ruby version
global Set or show the global Ruby version
shell Set or show the shell-specific Ruby version
install Install a Ruby version using ruby-build
uninstall Uninstall a specific Ruby version
rehash Rehash rbenv shims (run this after installing executables)
version Show the current Ruby version and its origin
versions List all Ruby versions available to rbenv
which Display the full path to an executable
whence List all Ruby versions that contain the given executable
See `rbenv help <command>' for information on a specific command.
For full documentation, see: https://github.com/rbenv/rbenv#readme
$ which bundle
/usr/local/bin/bundle
Avez-vous essayé 'rbenv rehash'? – ole
Je l'ai essayé sans changement –
Pouvez-vous montrer la valeur de la variable $ PATH ('echo $ PATH') et aussi la sortie de la commande' rbenv'? – ole