我通过以下教程正确安装了vps,ubuntu 10.04,rails 3,ruby和mysql.如果我运行bundle check
或bundle install
我收到错误'-bash:bundle:command not found'.从gem list --local
我看到'bundler(1.0.2,1.0.0)'已安装.
我不知道出了什么问题......
gem environment
收益:
RubyGems Environment: - RUBYGEMS VERSION: 1.3.7 - RUBY VERSION: 1.8.7 (2010-04-19 patchlevel 253) [i686-linux] - INSTALLATION DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8 - RUBY EXECUTABLE: /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby - EXECUTABLE DIRECTORY: /opt/ruby-enterprise-1.8.7-2010.02/bin - RUBYGEMS PLATFORMS: - ruby - x86-linux - GEM PATHS: - /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8 - /root/.gem/ruby/1.8 - GEM CONFIGURATION: - :update_sources => true - :verbose => true - :benchmark => false - :backtrace => false - :bulk_threshold => 1000 - REMOTE SOURCES: - http://rubygems.org/
并echo $PATH
返回:
/opt/myruby/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/bin/gem:/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/:/root/.gem/ruby/1.8
并which gem
返回:
/usr/bin/gem
locate bundle
收益:
/opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/
xxjjnn.. 195
我的问题是我做了:
sudo gem install bundler
所以我安装了root而不是我自己.所以我以root身份卸载,然后安装为我自己:
sudo gem uninstall bundler gem install bundler rbenv rehash
(如果你使用rbenv的最后一个命令)
它奏效了."正确的"路径是在.bashrc
(或其他壳轮廓),至少根据
$PATH => zsh: /Users/myself/.rbenv/shims:/Users/myself/.rbenv/bin: ... etc
但它期待它为我自己安装 - 而不是为root.在我的情况下,它的合法安装地点在~/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler
我的问题是我做了:
sudo gem install bundler
所以我安装了root而不是我自己.所以我以root身份卸载,然后安装为我自己:
sudo gem uninstall bundler gem install bundler rbenv rehash
(如果你使用rbenv的最后一个命令)
它奏效了."正确的"路径是在.bashrc
(或其他壳轮廓),至少根据
$PATH => zsh: /Users/myself/.rbenv/shims:/Users/myself/.rbenv/bin: ... etc
但它期待它为我自己安装 - 而不是为root.在我的情况下,它的合法安装地点在~/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/bundler
您需要将ruby gem可执行文件目录添加到路径中
export PATH=$PATH:/opt/ruby-enterprise-1.8.7-2010.02/bin
...也适用于Debian GNU/Linux 6.0 :)
export PATH=$PATH:/var/lib/gems/1.8/bin
我这样做了(Ubuntu最新截至2013年3月[我认为:)]):
sudo gem install bundler
归功于Ray Baxter.
如果你需要gem,我用这种方式安装Ruby(虽然这是长期征税):
mkdir /tmp/ruby && cd /tmp/ruby wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p327.tar.gz tar xfvz ruby-1.9.3-p327.tar.gz cd ruby-1.9.3-p327 ./configure make sudo make install