0

我正在尝试安装导轨。我对这些东西很陌生,如果我遗漏了一些明显的东西,我很抱歉。我已经完成了大部分工作,但是当我实际尝试“rails new blog”时,出现以下错误:

/Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:247:in `mkdir':    Permission denied - /rails_projects/blog (Errno::EACCES)
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:247:in `fu_mkdir'
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:221:in `block (2 levels) in mkdir_p'
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:219:in `reverse_each'
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:219:in `block in mkdir_p'
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:205:in `each'
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/1.9.1/fileutils.rb:205:in `mkdir_p'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:51:in `block in invoke!'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `call'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:114:in `invoke_with_conflict_check'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:50:in `invoke!'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/actions.rb:95:in `action'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/actions/empty_directory.rb:15:in `empty_directory'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/generators/app_base.rb:103:in `create_root'
from (eval):1:in `create_root'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/task.rb:22:in `run'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/invocation.rb:118:in `invoke_task'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `block in invoke_all'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `each'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `map'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/invocation.rb:124:in `invoke_all'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/group.rb:226:in `dispatch'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/thor-0.14.6/lib/thor/base.rb:389:in `start'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/commands/application.rb:38:in `<top (required)>'
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.3/lib/rails/cli.rb:15:in `<top (required)>'
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/gems/railties-3.2.3/bin/rails:7:in `<top (required)>'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/rails:19:in `load'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/rails:19:in `<main>'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in `<main>'

我已经四处寻找修复它的方法(尝试 gem install rails 几次,摆弄其他一些东西),但我无法让它工作。我真的很感激一些帮助。我正在开发 OS X Lion,并且已经安装了 Ruby 和 RVM 等等。不能为我的生活弄清楚我做错了什么。

谢谢!

萨沙

PS——如果我用“sudo”执行上述操作,它会返回:

/Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find railties (>= 0) amongst [bigdecimal-1.1.0, io-console-0.3, json-1.5.4, minitest-2.5.1, rake-0.9.2.2, rdoc-3.9.4] (Gem::LoadError)
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /Users/sashafklein/.rvm/rubies/ruby-1.9.3-p194/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/rails:18:in `<main>'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in `eval'
from /Users/sashafklein/.rvm/gems/ruby-1.9.3-p194@rails3tutorial2ndEd/bin/ruby_noexec_wrapper:14:in `<main>'

问题是,我肯定有铁路。并且尝试通过 gem install 重新安装并不能解决任何问题。

4

1 回答 1

2

我遇到了完全相同的问题(在 Mac 上)。当我尝试在 HOME 目录的文件夹中创建应用程序时,给了我同样的错误。但是当我在用户文件夹用户/用户名之一中尝试相同时,它起作用了。我猜想与root权限有关。希望这可以帮助。

于 2012-08-01T18:14:14.803 回答