我想为rails app安装bootstrap-sass,但失败了。
gem 'bootstrap-sass', '~> 3.3.5' #add it to Gemfile
然后bundle install
Bundler::GemspecError: Could not read gem at /Users/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/cache/autoprefixer-rails-5.2.1.2.gem. It may be corrupted.
An error occurred while installing autoprefixer-rails (5.2.1.2), and Bundler cannot continue.
Make sure that `gem install autoprefixer-rails -v '5.2.1.2'` succeeds before bundling.
然后我尝试运行命令gem install autoprefixer-rails -v '5.2.1.2'
,但仍然无效。
ERROR: Error installing autoprefixer-rails:
invalid gem: package is corrupt, exception while verifying: undefined method `size' for nil:NilClass (NoMethodError) in /Users/liuxingqi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/cache/autoprefixer-rails-5.2.1.2.gem
Rails版本:4.2.3
ruby版本:ruby 2.2.2p95
任何人都可以帮助我!
答案 0 :(得分:0)
我从缓存目录中删除了gem包,然后运行bundle install
,一切正常。
rm /Users/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/cache/autoprefixer-rails-5.2.1.2.gem
bundle install