Anthony To
Anthony To

Reputation: 2303

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.

I have my app at /path/to/app and symlinked it to pow:

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

I have my app set up with rvm:

$ rvm -v
rvm 1.25.0 (stable)

and my gemset set up with .ruby-version and .ruby-gemset. When I check rvm list and rvm gemset list I do get the right ruby version and gemset specified.

$ 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.

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. Didn't work.

I've installed bundler in my global gemset, but didn't fix it:

$ rvm gemset use global && gem install bundler

I also tried uninstalling pow and reinstalling but to no avail. I double and triple checked that my app is using the correct version of ruby. Additionally, pow works with other apps that I have symlinked.

Anyone have any thoughts? Thanks in advance.

Upvotes: 3

Views: 1884

Answers (1)

carpamon
carpamon

Reputation: 6623

Create a .powrc file in the root of your project and paste the following code:

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.

Upvotes: 1

Related Questions