Errno: EACCES:拒绝权限- /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-16/2.0.0/sqlite3-1.3.12/gem_make.out

时间:2022-01-22 22:59:18

I've been trying to start a new project of mine, but I had some issues using Rails.

我一直在尝试启动我的一个新项目,但是我在使用Rails时遇到了一些问题。

I start by saying that I'm using macOS Sierra 10.12 and Xcode version 8.0 (8A218a).

我首先说我正在使用macOS Sierra 10.12和Xcode版本8.0 (8A218a)。

When I write in the designed directory rails new projectname it happens as follows:

当我在设计的目录rails新projectname中写入时,会发生以下情况:

rails new hello_app
  create  
  create  README.rdoc
  create  Rakefile
  create  config.ru
  create  .gitignore
  create  Gemfile
  create  app
  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/assets/images/.keep
  create  app/mailers/.keep
  create  app/models/.keep
  create  app/controllers/concerns/.keep
  create  app/models/concerns/.keep
  create  bin
  create  bin/bundle
  create  bin/rails
  create  bin/rake
  create  bin/setup
  create  config
  create  config/routes.rb
  create  config/application.rb
  create  config/environment.rb
  create  config/secrets.yml
  create  config/environments
  create  config/environments/development.rb
  create  config/environments/production.rb
  create  config/environments/test.rb
  create  config/initializers
  create  config/initializers/assets.rb
  create  config/initializers/backtrace_silencers.rb
  create  config/initializers/cookies_serializer.rb
  create  config/initializers/filter_parameter_logging.rb
  create  config/initializers/inflections.rb
  create  config/initializers/mime_types.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  lib
  create  lib/tasks
  create  lib/tasks/.keep
  create  lib/assets
  create  lib/assets/.keep
  create  log
  create  log/.keep
  create  public
  create  public/404.html
  create  public/422.html
  create  public/500.html
  create  public/favicon.ico
  create  public/robots.txt
  create  test/fixtures
  create  test/fixtures/.keep
  create  test/controllers
  create  test/controllers/.keep
  create  test/mailers
  create  test/mailers/.keep
  create  test/models
  create  test/models/.keep
  create  test/helpers
  create  test/helpers/.keep
  create  test/integration
  create  test/integration/.keep
  create  test/test_helper.rb
  create  tmp/cache
  create  tmp/cache/assets
  create  vendor/assets/javascripts
  create  vendor/assets/javascripts/.keep
  create  vendor/assets/stylesheets
  create  vendor/assets/stylesheets/.keep
     run  bundle install
Ignoring ffi-1.9.14 because its extensions are not built.  Try: gem pristine ffi --version 1.9.14


Your user account isn't allowed to install to the system Rubygems.
You can cancel this installation and run:

  bundle install --path vendor/bundle

to install the gems into ./vendor/bundle/, or you can enter your
password
and install the bundled gems to Rubygems using sudo.

Password: 
Fetching gem metadata from ht.tps://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.......
Using rake 11.3.0
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.1
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using debug_inspector 0.0.2
Using bundler 1.11.2
Installing byebug 9.0.6 with native extensions

Errno::EACCES: Permission denied -      /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-16/2.0.0/byebug-  9.0.6/gem_make.out
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Using sass 3.4.22
Using tilt 2.0.5
Installing sqlite3 1.3.12 with native extensions

Errno::EACCES: Permission denied - /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-16/2.0.0/sqlite3-1.3.12/gem_make.out
Using turbolinks-source 5.0.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Installing nokogiri 1.6.8.1 with native extensions

Errno::EACCES: Permission denied - /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-16/2.0.0/nokogiri-1.6.8.1/gem_make.out
Using rack-test 0.6.3
Using mime-types 3.1
Using binding_of_caller 0.7.2
An error occurred while installing byebug (9.0.6), and Bundler cannot   continue.
Make sure that `gem install byebug -v '9.0.6'` succeeds before bundling.
     run  bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted

I tried some solutions but they didn't work. First of all:

我尝试了一些解决办法,但没有奏效。首先:

Ignoring ffi-1.9.14 because its extensions are not built. Try: gem pristine ffi --version 1.9.14

忽略fa -1.9.14,因为它的扩展没有构建。尝试:gem原始ffi——版本1.9.14。

Is it important? How can I work it out?

它是重要的?我怎么解决呢?

Then I have all the errors you can see, do you know how I can find a solution?

然后我有所有你能看到的错误,你知道我如何找到一个解决方案吗?

It's important that these solutions don't create problems in making all the project run on other unixlike machines, because it's a group work.

重要的是,这些解决方案不会在使所有项目在其他类unix机器上运行时产生问题,因为这是一个组工作。

Thank you a lot in advance.

非常感谢。

EDIT:

编辑:

even using sudo rails new helloapp the problems occurred. Besides I couldn't do anything without root permissions and that was a mess.

即使使用sudo rails新的helloapp也会出现问题。此外,如果没有root权限,我什么都做不了,这真是一团糟。

I installed manually byebug, nokogiri and ffi through this line:

我通过这一行手动安装了byebug, nokogiri和ffi:

sudo gem install -n /usr/local/bin gemname

sudo gem安装-n /usr/local/bin gemname。

This is the result:

这是由于:

rails new toyapp
      create  
      create  README.rdoc
      create  Rakefile
      create  config.ru
      create  .gitignore
      create  Gemfile
      create  app
      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/assets/images/.keep
      create  app/mailers/.keep
      create  app/models/.keep
      create  app/controllers/concerns/.keep
      create  app/models/concerns/.keep
      create  bin
      create  bin/bundle
      create  bin/rails
      create  bin/rake
      create  bin/setup
      create  config
      create  config/routes.rb
      create  config/application.rb
      create  config/environment.rb
      create  config/secrets.yml
      create  config/environments
      create  config/environments/development.rb
      create  config/environments/production.rb
      create  config/environments/test.rb
      create  config/initializers
      create  config/initializers/assets.rb
      create  config/initializers/backtrace_silencers.rb
      create  config/initializers/cookies_serializer.rb
      create  config/initializers/filter_parameter_logging.rb
      create  config/initializers/inflections.rb
      create  config/initializers/mime_types.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  lib
      create  lib/tasks
      create  lib/tasks/.keep
      create  lib/assets
      create  lib/assets/.keep
      create  log
      create  log/.keep
      create  public
      create  public/404.html
      create  public/422.html
      create  public/500.html
      create  public/favicon.ico
      create  public/robots.txt
      create  test/fixtures
      create  test/fixtures/.keep
      create  test/controllers
      create  test/controllers/.keep
      create  test/mailers
      create  test/mailers/.keep
      create  test/models
      create  test/models/.keep
      create  test/helpers
      create  test/helpers/.keep
      create  test/integration
      create  test/integration/.keep
      create  test/test_helper.rb
      create  tmp/cache
      create  tmp/cache/assets
      create  vendor/assets/javascripts
      create  vendor/assets/javascripts/.keep
      create  vendor/assets/stylesheets
      create  vendor/assets/stylesheets/.keep
         run  bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies.....
Using rake 11.3.0
Using i18n 0.7.0
Using json 1.8.3
Using minitest 5.9.1
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using debug_inspector 0.0.2
Using bundler 1.11.2
Using byebug 9.0.6
Using coffee-script-source 1.10.0
Using execjs 2.7.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Using sass 3.4.22
Using tilt 2.0.5
Using sqlite3 1.3.12
Using turbolinks-source 5.0.0
Using rdoc 4.2.2
Using tzinfo 1.2.2
Using nokogiri 1.6.8.1
Using rack-test 0.6.3
Using mime-types 3.1
Using binding_of_caller 0.7.2
Using coffee-script 2.4.1
Using uglifier 3.0.2
Using sprockets 3.7.0
Using turbolinks 5.0.1
Using sdoc 0.4.2
Using activesupport 4.2.6
Using loofah 2.0.3
Using mail 2.6.4
Using rails-deprecated_sanitizer 1.0.3
Using globalid 0.3.7
Using activemodel 4.2.6
Using jbuilder 2.6.0
Using spring 2.0.0
Using rails-html-sanitizer 1.0.3
Using rails-dom-testing 1.0.7
Using activejob 4.2.6
Using activerecord 4.2.6
Using actionview 4.2.6
Using actionpack 4.2.6
Using actionmailer 4.2.6
Using railties 4.2.6
Using sprockets-rails 3.2.0
Using coffee-rails 4.1.1
Using jquery-rails 4.2.1
Using rails 4.2.6
Using sass-rails 5.0.6
Using web-console 2.3.0
Bundle complete! 12 Gemfile dependencies, 56 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
         run  bundle exec spring binstub --all
* bin/rake: spring inserted
* bin/rails: spring inserted

Now everything should be okay, am I right?

现在一切都好了,对吗?

1 个解决方案

#1


0  

"Your user account isn't allowed to install to the system Rubygems". This means that you dont have write permissions to the gems installation dir. Install the gems (with errors in your log) using sudo gem install <gem_name> or say sudo bundle install

“您的用户帐户不允许安装到系统Rubygems中”。这意味着您没有对gems安装目录的写权限。使用sudo gem安装 或说sudo bundle安装来安装gems(日志中有错误)

#1


0  

"Your user account isn't allowed to install to the system Rubygems". This means that you dont have write permissions to the gems installation dir. Install the gems (with errors in your log) using sudo gem install <gem_name> or say sudo bundle install

“您的用户帐户不允许安装到系统Rubygems中”。这意味着您没有对gems安装目录的写权限。使用sudo gem安装 或说sudo bundle安装来安装gems(日志中有错误)