I wanna use the bundler, but after I installed rbenv, ruby and bundler, it still tells me command not found.
$ rbenv version
2.2.3 (set by /Users/khlee/.rbenv/version)
$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]
$ export GEM_HOME=$HOME/Software/ruby
$ gem install bundler
Successfully installed bundler-1.12.5
Parsing documentation for bundler-1.12.5
1 gem installed
$ rbenv rehash
$ bundle install
-bash: bundle: command not found
Execute below command and check list of gem in gemset:
rbenv gemset list
May be budler gem is not installed in current gemset.
Related
❯ rbenv version
system (set by /Users/eric.nguyen/.rbenv/version)
❯ rbenv local 2.4.2
❯ gem install bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
❯ rbenv global 2.4.2
❯ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]
❯ rbenv version
2.4.2 (set by /Users/eric.nguyen/.ruby-version)
❯ gem install bundler
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
❯ gem -v
2.0.14.1
Ruby version is is still 2.0.0p648
I'm on macOS Sierra 10.12.6.
I've done everything mentioned here
I've done:
rbenv rehash
put eval "$(rbenv init -)" in my .zshrc and source ~/.zshrc
put $HOME/.rbenv/shims into $PATH (/Users/eric.nguyen/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/eric.nguyen/Library/Android/sdk/tools:/Users/eric.nguyen/Library/Android/sdk/platform-tools:/Users/eric.nguyen/.rbenv/shims)
But it still doesn't change ruby version.
Restarting my computer resolve the issue.
❯ ruby -v
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16]
❯ gem -v
2.6.13
You always need to run rbenv rehash after you install a new ruby version using rbenv and also when you install a gem that has a command line options
I have reinstalled and updated my Ubuntu to 16.04, so now i have installed RVM for use Jekyll, but i have a problem when run bundle install of gemfile.
$ bundle install
Ignoring executable-hooks-1.3.2 because its extensions are not built.
Try: gem pristine executable-hooks --version 1.3.2
Ignoring gem-wrappers-1.2.7 because its extensions are not built. Try: gem pristine gem-wrappers --version 1.2.7
Your Ruby version is 2.3.1, but your Gemfile specified 2.2.0
$ ruby -v
ruby 2.2.0p0 (2014-12-25 revision 49005) [x86_64-linux]
$ rvm gemset list
gemsets for ruby-2.2.0 (found in /home/kedinn/.rvm/gems/ruby-2.2.0)
No running because this 2.3.1, but your Gemfile specified 2.2.0 why? if i have using ruby-2.2.0
It looks like you have both RVM and rbenv installed, and they are probably in conflict. Since they do more or less the same things, it should be safe to get rid of one of them. It means the rbenv installation of ruby is broken.
sudo rm -rf ~/.rbenv
Try installing Ruby like this
I'm trying to setup my environment to do development on Travis CI's dpl project.
I installed rbenv to manage my Ruby versions and I use Ruby 2.2.3.
Then I do bundle install and the gems are installed.
Then when I try to do bundle exec rake I get this error:
Could not find CFPropertyList-2.2.8 in any of the sources
Run `bundle install` to install missing gems.
This gem is installed. Can you tell me why it is not found by Bundler?
Here is a gist of the output of my commands: https://gist.github.com/cotsog/7bb87c84a636bcd3de65
Thanks for your help!
Update:
Additional info about my environment:
$ which ruby
/Users/me/.rbenv/shims/ruby
$ which bundler
/usr/bin/bundler
$ ruby --version
ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
$ bundler --version
Bundler version 1.10.6
I'm having a devil of a time installing Nokogiri on Ubuntu 12.04. I use rbenv.
$ gem install nokogiri -v '1.6.1'
ERROR: While executing gem ... (Errno::EACCES)
Permission denied - /home/deploy/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1/.autotest
$ sudo gem install nokogiri -v '1.6.1'
ERROR: Error installing nokogiri:
nokogiri requires Ruby version >= 1.9.2.
$ rbenv sudo gem install nokogiri -v '1.6.1'
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
/home/deploy/.rbenv/versions/2.0.0-p353/bin/ruby extconf.rb
Gem files will remain installed in /home/deploy/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1 for inspection.
Results logged to /home/deploy/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/nokogiri-1.6.1/ext/nokogiri/gem_make.out
$ ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
$ sudo ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
$ rbenv sudo ruby -v
ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]
$ echo $PATH
/home/deploy/.rbenv/bin:/home/deploy/.rbenv/bin:/home/deploy/.rbenv/shims:/home/deploy/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
It seems like I need some way of having sudo ruby -v give me 2.0.0. What am I missing?
You shouldn't need sudo when you do gem install with rbenv. Unfortunately, the ownership is usually not correct for the .rbenv directory on a new install.
Do this first to set your permissions correctly:
sudo chown -R $USER "$HOME/.rbenv"
Then go ahead and just run the install again:
gem install nokogiri -v '1.6.1'
It should work without sudo.
This works fine, but make sure to restart your terminal window after running sudo chown.
sudo chown -R $USER "$HOME/.rbenv"
# close terminal, then run the gem install
gem install nokogiri
I installed Ruby with rbenv. When trying to install Rails using gem install rails I get:
ERROR: Failed to build gem native extension.
I suspect that there is a conflict with my Ruby versions.
rbenv local and rbenv global are set to 1.9.3-p327, but if I type ruby -v I get "ruby 1.8.7".
How can I change this to 1.9.3?
echo $PATH:
/usr/local/opt/rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Try:
rbenv local 1.9.3-p327
and then
rbenv rehash just to be sure.
Also, you can set 1.9.3-p327 as the default with:
rbenv global 1.9.3-p327