[英]Rails 4, ruby-2.0.0-p247, pow, rvm - LoadError: cannot load such file — bundler/setup
I've been having a bunch of issues with pow all of a sudden and I cannot figure out why. 我突然遇到了很多与pow有关的问题,我无法弄明白为什么。
I have my app at /path/to/app
and symlinked it to pow: 我将我的应用程序放在
/path/to/app
并将其符号链接到pow:
$ cd ~./pow
$ ln -s /path/to/app app_name
I have my app set up with rvm: 我的应用程序设置为rvm:
$ rvm -v
rvm 1.25.0 (stable)
and my gemset set up with .ruby-version
and .ruby-gemset
. 我的gemset设置了
.ruby-version
和.ruby-gemset
。 When I check rvm list
and rvm gemset list
I do get the right ruby version and gemset specified. 当我检查
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
Here is the issue: when I visit app_name.dev/
in browser I get the following error. 这是问题:当我在浏览器中访问
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>'
Now as per the pow trouble shooting guide, I tried 现在按照战俘故障排除指南,我试过了
echo "export POW_RVM_PATH=/usr/local/rvm/scripts/rvm" >> ~/.powconfig
while replacing /usr/local/rvm/
with my rvm installation location and restarted pow. 用我的rvm安装位置替换
/usr/local/rvm/
并重新启动pow。 Didn't work. 没工作。
I've installed bundler in my global gemset, but didn't fix it: 我在我的全局gemset中安装了bundler,但没有解决它:
$ rvm gemset use global && gem install bundler
I also tried uninstalling pow and reinstalling but to no avail. 我也尝试卸载pow并重新安装,但无济于事。 I double and triple checked that my app is using the correct version of ruby.
我加倍检查我的应用程序是否正在使用正确版本的ruby。 Additionally, pow works with other apps that I have symlinked.
此外,pow可以与我已经符号链接的其他应用程序一起使用。
Anyone have any thoughts? 有人有什么想法? Thanks in advance.
提前致谢。
Create a .powrc
file in the root of your project and paste the following code: 在项目的根目录中创建
.powrc
文件并粘贴以下代码:
if [ -f "$rvm_path/scripts/rvm" ]; then
source "$rvm_path/scripts/rvm"
rvm use .
fi
Close the terminal, cd
to your project and restart the server. 关闭终端,
cd
到您的项目并重新启动服务器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.