Joshua E
Joshua E

Reputation: 384

Issue with Deploying Ruby on Rails on my Hosting Service

So I am trying to deploy a Rails app on my web hosting service. I have developed an app locally, but this is the first time I have tried to get it to work on another server. My service provider is Blue Host and I am on their most basic shared hosting plan. Just as a test, I created a fresh application on the server, and everything ran fine. However, whenever I add any gem to the Gemfile and run 'bundle install', I get this error:

sudo: unable to stat /etc/sudoers: No such file or directory
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

Gem::Exception: Cannot load gem at [/usr/lib64/ruby/gems/1.9.3/cache/rake-10.4.2.gem] in /home/user/application
An error occurred while installing rake (10.4.2), and Bundler cannot continue.
Make sure that `gem install rake -v '10.4.2'` succeeds before bundling.

Whenever I run gem install rake -v '10.4.2' the gem installs fine.

I get similar errors that mention 'sudo' when i try to run other commands as well.
I am not quite sure what this error means. Do I not have the required permissions on my server?

Upvotes: 2

Views: 113

Answers (2)

vijay
vijay

Reputation: 177

Go with root user

su root
root$ /etc/

Upvotes: 1

bukk530
bukk530

Reputation: 1895

Always use a continuous deployment/integration.

Capistrano does part of the job. It is very simple, you develop you application offline, push to a remote repository, like BitBucket or Github, and then Capistrano takes care of cloning the remote repository to your server (you can also have many), restarting services etc.

If you want to go a step forward you can use continuous integration, so when you push to remote tests will automatically be performed and if they pass your application will be deployed.

This is a basic introduction on how deployment works, you can check online, there are plenty of resources about how to deploy rails.

Upvotes: 1

Related Questions