简体   繁体   English

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

[英]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 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

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.

相关问题 未安装ruby-2.0.0-p247 - ruby-2.0.0-p247 is not installed Ruby on Rails:错误“require”:无法加载此类文件——bundler/setup (LoadError) - Ruby on Rails: Error `require': cannot load such file -- bundler/setup (LoadError) 试图用珠宝盒更新ruby ruby​​-2.0.0-p247 - Trying to update ruby ruby-2.0.0-p247 with jewelry box /.rvm/gems/ruby-2.0.0-p481/gems/ruby-debug-ide-0.4.22/lib/ruby-debug-ide.rb:8:在`require&#39;中:无法加载此类文件-降级( LoadError) - /.rvm/gems/ruby-2.0.0-p481/gems/ruby-debug-ide-0.4.22/lib/ruby-debug-ide.rb:8:in `require': cannot load such file — debase (LoadError) 带有@global gem的Ruby / RVM - bundle运行失败,带有`require&#39;:无法加载这样的文件 - bundler(LoadError) - Ruby/RVM with @global gem - bundle run fails with `require': cannot load such file — bundler (LoadError) `require&#39;:无法加载此类文件-捆绑程序/安装程序(LoadError) - `require': cannot load such file — bundler/setup (LoadError) LoadError:无法加载此类文件—捆绑程序/设置capistrano - LoadError: cannot load such file — bundler/setup capistrano 加载错误:无法加载此类文件 -- 捆绑程序/设置 - LoadError: cannot load such file -- bundler/setup 软件包更新将gem安装到~/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0 - Bundle update installs gems into ~/.rvm/gems/ruby-2.0.0-p247@railstutorial_rails_4_0 Rails服务器正常工作,Rails控制台无效。 `require&#39;:无法加载此类文件-捆绑程序/安装程序(LoadError)- - Rails server works, Rails console does not. `require': cannot load such file — bundler/setup (LoadError) -
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM