Ruby: “gem install bundler” not installing bundler

 ̄綄美尐妖づ 提交于 2019-12-01 07:19:55

问题


I'm new to rails and trying to get a demo app up and running. I've been having problems on my linux system (lubuntu, mostly clean install) getting "bundle install" to run. Even when it does, if I close my terminal and start another, it fails to run again. The cycle looks something like this:

sandbox@75bf7f3:~/railsstuff/sample_app_2nd_ed$ bundle install
ERROR: Gem bundler is not installed, run `gem install bundler` first.

sandbox@75bf7f3:~/railsstuff/sample_app_2nd_ed$ gem install bundler
Successfully installed bundler-1.1.4
1 gem installed

sandbox@75bf7f3:~/railsstuff/sample_app_2nd_ed$ bundle install
ERROR: Gem bundler is not installed, run `gem install bundler` first.

As far as I can tell, I'm using the latest version of Ruby and rvm seems to be working fine.

Can anyone explain what's going on here?


回答1:


I can confirm this is happening in a fresh rvm install of Linux Mint. I'm using gnome-terminal and I have applied the "Run command as login shell" workaround. I'm using ruby 1.9.3 and haven't done anything with gemsets. When I type 'gem list' I see all the rubies I've installed (the first hour I got rvm installed, I playing around installing some projects and it seemed to be in perfect working order).

It looks like adding

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm"

to ~/.bashrc clears up the inconsistency problems. It's odd that it was working fine initially without it... And it should only be sourcing .bash_login in the first place...



来源:https://stackoverflow.com/questions/11296737/ruby-gem-install-bundler-not-installing-bundler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!