Rails 4,ruby-2.0.0-p247,pow,rvm - LoadError:无法加载这样的文件 - bundler/setup

问题描述:

我一直有一堆问题与pow一下子,我不明白为什么。Rails 4,ruby-2.0.0-p247,pow,rvm - LoadError:无法加载这样的文件 - bundler/setup

我有我的/path/to/app的应用程序和符号链接使其数值:

$ cd ~./pow
$ ln -s /path/to/app app_name

我有我的应用程序设置了RVM:

$ rvm -v
rvm 1.25.0 (stable)

和我的宝石套装搭配.ruby-version.ruby-gemset。当我检查rvm listrvm 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安装位置并重新启动POW更换/usr/local/rvm/。没有工作。

我已经安装了捆绑在我的全球宝石,但并没有解决它:

$ rvm gemset use global && gem install bundler 

我也试着卸载战俘并重新安装,但无济于事。 我加倍和检查了我的应用程序使用正确版本的红宝石。 此外,pow与我已经符号链接的其他应用程序一起工作。

任何人有任何想法?提前致谢。

+1

你有没有读过这个http://rvm.io/integration/pow? – mpapis

+0

这是为我做的。谢谢! –

创建.powrc文件在你的项目的根目录,并粘贴以下代码:

if [ -f "$rvm_path/scripts/rvm" ]; then 
    source "$rvm_path/scripts/rvm" 
    rvm use . 
fi 

关闭终端,cd到项目,并重新启动服务器。

+0

感谢您的回复。我实际上已经有了.powrc,忘了提及早些时候 –

+1

.powrc是否包含该脚本?关闭终端并再次进入该项目。 –