我已經搜索了一段時間,但無法解決問題。我在一臺相對較新的計算機(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.
在搜索時我發現了peo有類似的外觀錯誤,但我找不到解決我的具體問題的任何事情。
我使用ruby 2.0.0和rails 2.3.13。
我真的卡住了,希望有人知道如何解決這個問題。提前致謝!
更新:我注意到,當我運行軌道的新應用程序的命令,終端問我
Enter your password to install the bundled RubyGems to your system:
它從來沒有這樣做過。我有可能改變了系統上的某些東西嗎?
Update2:對此使用2+天后,據我所知,解決方案是完全重新安裝最新版本的ruby和rails。
您使用[RVM(https://rvm.io)? –
另請注意,使用rails時,最好將gem文件放入'Gemfile'並讓'bundle'(或'sudo bundle')進行安裝。你可能也想看看'rvm'。 –
是的,我正在使用rvm,但我不知道如何使用它來解決這個問題。 「rails new」成功後不會使用「sudo bundle」嗎?這似乎是整個初始設置得到中止的方式太早?非常感謝! – Linus