gsmafra gsmafra - 1 year ago 116
Linux Question

Rails looking for wrong path of bundler

I'm trying to create a new Ruby-on-Rails application with a fresh installation on Linux. When I execute

rails new appname -d postgresql

I receive the following error

run bundle install --local
/usr/bin/ruby2.3: No such file or directory -- /usr/bin/bundle (LoadError)
run bundle exec spring binstub --all
/usr/bin/ruby2.3: No such file or directory -- /usr/bin/bundle (LoadError)

is installed in a different path:

$ which bundle

Is it preferable to change the path of
or to specify to
that it is in a different path? And what is the best way to do it (either changing the path or specifying it)?

Answer Source

add PATH=$PATH:$HOME/.gem/ruby/<version>/bin to your .bash_profile and source it.

Then you can install gems for your user without sudo with gem install bundler --install-dir ~/.gem

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download