我正在尝试安装rails。我是新手,对不起,如果我遗漏了一些明显的东西。我有大部分工作,但当我真正尝试“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>'
我一直在寻找一种方法来解决它(尝试了几次宝石安装导轨,摆弄其他一些东西),但我无法让它工作。我真的很感激一些帮助。我正在研究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重新安装并不能解决任何问题。
答案 0 :(得分:2)
我遇到了完全相同的问题(在Mac上)。当我尝试在HOME目录中的文件夹中创建应用程序时,给我同样的错误。但是,当我在其中一个用户文件夹用户/用户名中尝试相同时,它工作。我想与root权限有关。希望这会有所帮助。