简体   繁体   English

Rails新应用由于权限而失败

[英]Rails new app fails due to permissions

I've searched for some time now but can't solve the problem. 我已经搜索了一段时间,但无法解决问题。 I'm on a relatively new computer (osx), only created one rails app on it so far. 我在相对较新的计算机(osx)上,到目前为止仅在其上创建了一个Rails应用程序。 Until now everything went well. 到现在为止,一切进展顺利。 I'm now trying to create a new app using 我现在正在尝试使用创建一个新的应用程序

rails new appname

This is what the terminal shows me: 这是终端向我显示的内容:

      create  
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      create  app/assets/images/rails.png
      create  app/assets/javascripts/application.js
      create  app/assets/stylesheets/application.css
      create  app/controllers/application_controller.rb
      create  app/helpers/application_helper.rb
      create  app/views/layouts/application.html.erb
      create  app/mailers/.gitkeep
      create  app/models/.gitkeep
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.rb
      create  config/initializers/secret_token.rb
      create  config/initializers/session_store.rb
      create  config/initializers/wrap_parameters.rb
      create  config/locales
      create  config/locales/en.yml
      create  config/boot.rb
      create  config/database.yml
      create  db
      create  db/seeds.rb
      create  doc
      create  doc/README_FOR_APP
      create  lib
      create  lib/tasks
      create  lib/tasks/.gitkeep
      create  lib/assets
      create  lib/assets/.gitkeep
      create  log
      create  log/.gitkeep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/index.html
      create  public/robots.txt
      create  script
      create  script/rails
      create  test/fixtures
      create  test/fixtures/.gitkeep
      create  test/functional
      create  test/functional/.gitkeep
      create  test/integration
      create  test/integration/.gitkeep
      create  test/unit
      create  test/unit/.gitkeep
      create  test/performance/browsing_test.rb
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.gitkeep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.gitkeep
      create  vendor/plugins
      create  vendor/plugins/.gitkeep
         run  bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching gem metadata from https://rubygems.org/..
Resolving dependencies...
Using rake (10.0.4) 
Using i18n (0.6.1) 
Using multi_json (1.7.4) 
Using activesupport (3.2.13) 
Using builder (3.0.4) 
Using activemodel (3.2.13) 
Using erubis (2.7.0) 
Using journey (1.0.4) 
Using rack (1.4.5) 
Using rack-cache (1.2) 
Using rack-test (0.6.2) 
Using hike (1.2.2) 
Installing tilt (1.4.1) 
Errno::EACCES: Permission denied - /Library/Ruby/Gems/1.8/build_info/tilt-1.4.1.info
An error occurred while installing tilt (1.4.1), and Bundler cannot continue.
Make sure that `gem install tilt -v '1.4.1'` succeeds before bundling.

When I enter 当我进入

gem install tilt -v '1.4.1'

I get the following: 我得到以下内容:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /Library/Ruby/Gems/1.8 directory.

While searching I've found people with similar looking errors but I couldn't find anything solving my specific problem. 在搜索时,我发现人的相貌相似,但找不到解决我特定问题的方法。

I'm using ruby 2.0.0 and rails 2.3.13. 我正在使用ruby 2.0.0和rails 2.3.13。

I really stuck and hope someone knows how to fix this. 我真的很坚持,希望有人知道如何解决这个问题。 Thanks in advance! 提前致谢!

Update: I noticed, when I run the rails new app command, the terminal asks me 更新:我注意到,当我运行rails new app命令时,终端问我

Enter your password to install the bundled RubyGems to your system: 

It has never done this before. 它从来没有这样做过。 Is it possible that I kind of have changed something on the system? 我是否有可能更改了系统上的某些内容?

Update2: After using 2+ days on this, as far as I can say, the solution was to completely reinstall the latest versions of ruby and rails. Update2:据我所言,经过2天以上的处理,解决方案是完全重新安装最新版本的ruby和rails。

尝试sudo或在您可以访问的目录中创建您的应用

尝试sudo gem install tilt -v '1.4.1'

If the sudo "gem install tilt -v '1.4.1'" doesn't work. 如果sudo“宝石安装倾斜-v'1.4.1'”不起作用。 Then most likeley, the group "others" don't have correct permissions in your Ruby innstall. 然后最喜欢的人是,“其他”组在您的Ruby安装中没有正确的权限。 Make sure, you give correct permissions for group=others or users running the command in your: 确保为您的组=其他或运行该命令的用户提供了正确的权限:

/Library/Ruby/Gems/1.8 /Library/Ruby/Gems/1.8

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM