0

我已经搜索了一段时间,但无法解决问题。我在一台相对较新的计算机(osx)上,到目前为止只在其上创建了一个 rails 应用程序。直到现在一切都很顺利。我现在正在尝试使用

rails new appname

这是终端向我展示的内容:

      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.

当我进入

gem install tilt -v '1.4.1'

我得到以下信息:

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

在搜索时,我发现有类似外观错误的人,但我找不到任何解决我的具体问题的方法。

我正在使用 ruby​​ 2.0.0 和 rails 2.3.13。

我真的卡住了,希望有人知道如何解决这个问题。提前致谢!

更新:我注意到,当我运行 rails new app 命令时,终端问我

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

它以前从未这样做过。有没有可能我改变了系统上的某些东西?

Update2:据我所知,在使用 2 天以上之后,解决方案是完全重新安装最新版本的 ruby​​ 和 rails。

4

3 回答 3

2

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

于 2013-05-28T14:28:47.627 回答
1

尝试sudo gem install tilt -v '1.4.1'

于 2013-05-28T14:25:49.697 回答
1

如果 sudo "gem installtilt -v '1.4.1'" 不起作用。那么最有可能的是,“其他”组在您的 Ruby 安装中没有正确的权限。确保您为 group=others 或运行以下命令的用户提供正确的权限:

/图书馆/Ruby/Gems/1.8

于 2013-05-28T14:51:30.083 回答