I am trying to run the command: su - <username> -c RAILS_ENV=production rake assets:precompile
as root, even though ruby, rvm and all gems were installed as an another user. Thats because, I have lost access to the computer from which I could login to the server with that username.
So when I run the above command, I get the following error:
rake aborted!
No Rakefile found (looking for: rakefile, Rakefile, rakefile.rb, Rakefile.rb)
I am in the rails app directory when executing the above command. ls
gives me:
Gemfile README.rdoc app config db log public test vendor
Gemfile.lock Rakefile bin config.ru lib migrate solr tmp
Similarily if I do: su - <username> -c "bundle"
, I get the error: Could not locate Gemfile
.
I have read posts on SO such as Link #1, Link #2, Link #3, Link #4, but none have been able to resolve the issue.
Please if someone knows the method to resolve this and can give me an answer that will be a huge relief.