0
我很難在寶貝環境中正確加載寶石。我在'/ usr/local'(從http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard/的說明中)安裝了ruby和rubygems,我用'gem install gem-name'安裝了一些gem。寶石裝載問題
我正確地看到了創業板名單:
$ gem list
*** LOCAL GEMS ***
chrisjpowers-iterm_window (0.3.2)
gemcutter (0.3.0)
我可以看到正確安裝寶石:
$ ls /usr/local/lib/ruby/gems/1.8/gems/
chrisjpowers-iterm_window-0.3.2
gemcutter-0.3.0
,正確定義的寶石路徑:
$ gem env path
/usr/local/lib/ruby/gems/1.8
我定義各種路徑在我的bash配置文件中:
$ cat ~/.bash_profile
export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"
export GEM_HOME="/usr/local/lib/ruby/gems/1.8"
export GEM_PATH="/usr/local/lib/ruby/gems/1.8"
export RUBY_LIB="/usr/local/lib/ruby:/usr/local/lib/ruby/site_ruby"
然而,當我運行下面的腳本
#!/usr/local/bin/ruby
require 'rubygems'
require 'chrisjpowers-iterm_window'
我收到以下錯誤
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require': no such file to load -- chrisjpowers-iterm_window (LoadError)
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/local/bin/sp:4
我不知道如何解決它,任何幫助,將不勝感激:)