Rails 'bundle install' 失败,因为试图写入文件 'is unsupported by your OS'

Rails 'bundle install' fails because attempt to write to file 'is unsupported by your OS'

我正在尝试 运行 在我的本地计算机上开发其他地方开发的 rails 应用程序,但我无法在本地 运行 获取它。当我 运行 rails s 获取服务器 运行ning 时,我得到:

Could not find proper version of railties (4.2.6) in any of the sources
Run `bundle install` to install missing gems.

所以,很自然地,我 运行 bundle install 但得到错误:

Attempting to write to
`/home/rails/apps/intranet/shared/bundle/ruby/2.2.0` is
unsupported by your OS

我的 OS 是 macOS Sierra 版本 10.12.4.

此外,railties 在 gem 文件夹中,似乎是正确的版本。

提前致谢。

编辑:添加 Gemfile

source 'https://rubygems.org'


# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/rails/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc

# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'

# Use Unicorn as the app server
gem 'unicorn'

# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development

gem 'devise'
gem 'rails_admin'
gem 'carrierwave'
gem 'where-or'

# Railties
gem 'railties', '~> 4.2', '>= 4.2.6'

group :development, :test do
  # Call 'byebug' anywhere in the code to stop execution and get a debugger console
  gem 'byebug'
  gem 'rspec-rails'
  gem 'factory_girl_rails'
  gem 'pry-rails'
end

group :development do
  # Access an IRB console on exception pages or by using <%= console %> in views
  gem 'web-console', '~> 2.0'

  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  gem 'spring'
  gem 'guard', require: false
  gem 'guard-rspec', require: false
  gem 'guard-bundler', require: false
  gem "guard-cucumber", require: false
  gem 'ruby_gntp'
  gem 'terminal-notifier'
  gem 'terminal-notifier-guard'
  gem 'thin'
  gem 'quiet_assets'
  gem 'capistrano-rails'
  gem 'capistrano-rvm'
  gem 'capistrano3-unicorn'
  gem 'capistrano-bundler'
  gem 'better_errors'
  gem 'binding_of_caller'
end

group :test do
  gem 'database_cleaner'
  gem 'capybara'
  gem 'shoulda-matchers'
  gem 'poltergeist'
  gem 'launchy'
  gem "cucumber-rails", require: false
end

检查您是否对目录有写入权限/home/rails/apps/intranet/shared/bundle/ruby/2.2.0`

找出问题所在。由于这是从远程服务器下载的,因此 .bundle/config 文件的路径与 'BUNDLE_PATH' 不同。我只需要将其更改为我自己计算机上的路径而不是远程服务器上的路径,我就不再收到错误了。