簡體   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

我突然遇到了很多與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 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安裝位置替換/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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM