I am using bundle to install all the needed gems into a local folder for the ease of development and testing
我正在使用bundle将所有需要的gem安装到本地文件夹中,以便于开发和测试
bundle install --path vendor/bundle
And I can find libs are being installed under the folder "vendor/bundle", but how to tell my ruby to use that folder as well?
我可以在“供应商/bundle”文件夹下找到libs,但是如何告诉我的ruby也可以使用这个文件夹呢?
e.g. When I start my program in the shell
当我在shell中启动程序时
/Users/howard/.rbenv/versions/1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:51:in `require': cannot load such file -- yajl (LoadError)
But yajl is under the folder /vendor/bundle/ruby/1.9.1/gems/yajl-ruby-1.1.0/
但是yajl位于文件夹/供应商/bundle/ruby/1.9.1/gems/yajl-ruby-1.1.0/之下
2 个解决方案
#1
4
This is too obvious, but just in case... Did you try:
这太明显了,但以防万一……你试过:
bundle exec your_script.rb
#2
1
Simply install the bundle or create a gemset. then try.
只需安装bundle或创建gemset。然后试一试。
#1
4
This is too obvious, but just in case... Did you try:
这太明显了,但以防万一……你试过:
bundle exec your_script.rb
#2
1
Simply install the bundle or create a gemset. then try.
只需安装bundle或创建gemset。然后试一试。