Search code examples
ruby-on-railsrubyruby-on-rails-5

Bundler warning when running "bundle" - Ruby on Rails


I installed ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin16] versions using rbenv, and rails with the following version Rails 5.1.4

after creating a new app via rails new my-app

I am getting the followig error when I try to run bundle

The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java. There was an error while trying to write to /Users/my-user/.bundle/cache/compact_index/rubygems.org.443.29b0360b937aa4d161703e6160654e47/versions. It is likely that you need to grant write permissions for that path.```


Solution

  • Just remove this line from your Gemfile

    gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
    

    because you obviously do not run your application on any of these platforms.

    Then run bundle install again.