Question

I am trying to setup rake via this doc.

http://octopress.org/docs/setup/

But I get some errors.

ikhthiandor@ikhthiandor-Satellite-L450:/opt/octopress$ rake install
## Copying classic theme into ./source and ./sass
mkdir -p source
rake aborted!
Permission denied - source

Tasks: TOP => install
(See full trace by running task with --trace)

With sudo I get this output.

ikhthiandor@ikhthiandor-Satellite-L450:/opt/octopress$ sudo rake install
rake aborted!
no such file to load -- bundler/setup

(See full trace by running task with --trace)

Here is a list of files in the directory.

ikhthiandor@ikhthiandor-Satellite-L450:/opt/octopress$ ls -a
.                   config.ru     .git        Rakefile         .slugignore
..                  _config.yml   .gitignore  .rbenv-version   .themes
CHANGELOG.markdown  Gemfile       plugins     README.markdown
config.rb           Gemfile.lock  .powrc      .rvmrc

How can I solve the problem?

Was it helpful?

Solution

Ikhthiandor: Looks like you are a beginner in the ruby/rails world.

By running the rake install command, you are installing the default octopress theme using the rake tool. Not trying to setup rake as you mention in the question.

The first error ( Permission denied - source when trying mkdir -p source - as you correctly guessed - is because the user doesn't have permissions to create that directory.

The second error ( no such file to load -- bundler/setup ) is because the previous install dependencies steps are not performed correctly (for the user running this command).

The install dependencies steps to be completed successfully are:

1. gem install bundler
2. rbenv rehash    # If you use rbenv, rehash to be able to run the bundle command
3. bundle install

I am guessing you ran these steps successfully as 'ikhthiandor' user, so the bundler gem is not available for the 'sudo' user.

You can fix this by either of the following options:

  1. changing permissions on /opt/octopress folder so that 'ikhthiandor' user has rights to create sub-folders/files within.
  2. Run all the commands in the Octopress Setup doc as 'sudo'

Best practice would be to use either rvm or rbenv to manage custom installations of ruby environments per user (and not do everything as super user).

If you are indeed a fresher in the ruby-rails world, and want to step up your knowledge of the tools and the best practices in the ruby/rails world, I suggest browsing through the first few chapters of the Ruby on Rails Tutorial book that is available for free on-line.

HTH

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top