[英]Rails 4, ruby-2.0.0-p247, pow, rvm - LoadError: cannot load such file — bundler/setup
我突然遇到了很多与pow有关的问题,我无法弄明白为什么。
我将我的应用程序放在/path/to/app
并将其符号链接到pow:
$ cd ~./pow
$ ln -s /path/to/app app_name
我的应用程序设置为rvm:
$ rvm -v
rvm 1.25.0 (stable)
我的gemset设置了.ruby-version
和.ruby-gemset
。 当我检查rvm list
和rvm gemset list
我确实得到了正确的ruby版本和gemset指定。
$ rvm list
rvm rubies
ruby-1.9.3-p362 [ x86_64 ]
ruby-1.9.3-p448 [ x86_64 ]
=* ruby-2.0.0-p247 [ x86_64 ]
ruby-2.0.0-p353 [ x86_64 ]
# => - current
# =* - current && default
# * - default
$ rvm gemset list
gemsets for ruby-2.0.0-p247 (found in /Users/anthony/.rvm/gems/ruby-2.0.0-p247)
(default)
=> appgemset
这是问题:当我在浏览器中访问app_name.dev/
,我收到以下错误。
LoadError: cannot load such file -- bundler/setup
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
~/path/to/app/config/boot.rb:6:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
~/path/to/app/config/application.rb:1:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
~/path/to/app/config/environment.rb:2:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
~/path/to/app/config.ru:2:in `block in <main>'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/builder.rb:4:in `instance_eval'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/builder.rb:4:in `initialize'
~/path/to/app/config.ru:1:in `new'
~/path/to/app/config.ru:1:in `<main>'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:50:in `eval'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:50:in `load_config'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:43:in `initialize'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:13:in `new'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/lib/nack/server.rb:13:in `run'
~/Library/Application Support/Pow/Versions/0.4.1/node_modules/nack/bin/nack_worker:4:in `<main>'
现在按照战俘故障排除指南,我试过了
echo "export POW_RVM_PATH=/usr/local/rvm/scripts/rvm" >> ~/.powconfig
用我的rvm安装位置替换/usr/local/rvm/
并重新启动pow。 没工作。
我在我的全局gemset中安装了bundler,但没有解决它:
$ rvm gemset use global && gem install bundler
我也尝试卸载pow并重新安装,但无济于事。 我加倍检查我的应用程序是否正在使用正确版本的ruby。 此外,pow可以与我已经符号链接的其他应用程序一起使用。
有人有什么想法? 提前致谢。
在项目的根目录中创建.powrc
文件并粘贴以下代码:
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
rvm use .
fi
关闭终端, cd
到您的项目并重新启动服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.