I have a problem with bundle install. I have a fresh droplet with Rails and Ubuntu. If I run as root:
bundle install
I get the following message and my application breaks, start getting “Bad Gateway” errors from Nginx:
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
If I run bundle install as the rails user:
su rails
bundle install
then I get this error:
sh: 1: bundle: not found
What am I missing? I’ve scoured the internet and tried every solution I can find and can’t get it working quite right.
Thanks for your help,
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The ruby installation on the Rail on Rails One-Click application is managed by RVM. If you run which bundle you can see that the binary is installed to:
# which bundle
/usr/local/rvm/gems/ruby-2.1.3/bin/bundle
The rails user doesn’t have a login shell, so you’d need to manually source the file /etc/profile.d/rvm.sh to access the Ruby installation.
You can set a proper login shell for the rails user by running:
chsh -s /bin/bash rails
Then switch to the user with: su - rails From man su
-, -l, --login
Provide an environment similar to what the user would expect had the user logged in directly.
For more info on the One-Click application, check out:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.