我正在尝试通过这个文档设置rake。
http://octopress.org/docs/setup/
但是我得到了一些错误。
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)使用sudo可以得到以下输出。
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)以下是目录中的文件列表。
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我该如何解决这个问题?
发布于 2012-10-13 07:36:00
Ikhthiandor:看起来您是ruby/rails世界的初学者。
通过运行rake install命令,您将使用rake tool安装默认的octopress主题。不是你在问题中提到的trying to setup rake。
第一个错误(在尝试mkdir -p source时出现Permission denied - source )-正如您正确猜测的那样-是因为用户没有创建该目录的权限。
第二个错误( no such file to load -- bundler/setup )是因为前面的install dependencies步骤没有正确执行(对于运行此命令的用户)。
要成功完成的安装依赖项步骤包括:
1. gem install bundler
2. rbenv rehash # If you use rbenv, rehash to be able to run the bundle command
3. bundle install我猜您是以'ikhthiandor‘用户的身份成功运行了这些步骤,因此'sudo’用户无法使用bundler gem。
您可以通过以下任一选项修复此问题:
/opt/octopress文件夹的权限,以便'ikhthiandor‘用户有权在其中创建子文件夹/文件。身份运行Octopress Setup doc中的所有命令
最佳实践是使用rvm或rbenv来管理每个用户的ruby环境的自定义安装(而不是以超级用户的身份执行所有操作)。
如果您确实是ruby-rails世界的新手,并且想提高您对ruby/rails世界中的工具和最佳实践的了解,我建议您浏览在线免费提供的Ruby on Rails Tutorial书籍的前几章。
HTH
https://stackoverflow.com/questions/12829181
复制相似问题