Ruby rake安装不适用于octopress
我正试图通过此文档设置rake 但是我有一些错误Ruby rake安装不适用于octopress,ruby,rake,octopress,Ruby,Rake,Octopress,我正试图通过此文档设置rake 但是我有一些错误 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 runn
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
我怎样才能解决这个问题呢?Ikhthiandor:看起来你是ruby/rails领域的初学者 通过运行
rake install
命令,您正在使用安装默认的octopress主题。不是您在问题中提到的试图设置rake的
第一个错误(Permission denied-source
在尝试mkdir-p source
时,正如您正确猜测的那样)是因为用户没有创建该目录的权限
第二个错误(没有要加载的文件--bundler/setup
)是因为没有正确执行前面的安装依赖项
步骤(对于运行此命令的用户)
要成功完成的安装依赖项步骤包括:
1. gem install bundler
2. rbenv rehash # If you use rbenv, rehash to be able to run the bundle command
3. bundle install
我猜您作为“ikhthiandor”用户成功地运行了这些步骤,因此bundler gem不适用于“sudo”用户
您可以通过以下任一选项修复此问题:
更改/opt/octopress
文件夹的权限,以便“ikhthiandor”用户有权在中创建子文件夹/文件
以“sudo”的形式运行中的所有命令
最佳实践是使用或管理每个用户的ruby环境的自定义安装(而不是作为超级用户做所有事情)
如果您确实是ruby rails领域的新手,并且想进一步了解ruby/rails领域的工具和最佳实践,我建议您在线免费浏览本书的前几章
HTH你说得对。我是ruby世界的初学者。顺便说一句,我的意思是设置octopress而不是rake(这是一个打字错误)。根据你的建议,我让ikhthiandor成为/opt/octopress的所有者。当时它工作正常。感谢你花时间回复:)我从Zed Shaw的书开始学习ruby。我正忙于学习其他核心知识,所以我计划把ruby分成小块。因此,学习ruby的基础知识需要一些时间。一旦我掌握了rvm,rbenv的东西,我将根据最佳实践重新进行设置。我的问题中有一个输入错误。我想说,“我正试图通过这个文档设置octopress。”