开发者

How do I update rack when using rails 3? Bundler won't let me!

I'm getting the following error when using a file_field_tag: EOFError (bad content body). This is a known error, and the solution is to update rack-mount.

Unfortunately, if I run "bundle update rack-mount" I get the following error:

Bundler could not find compatible versions for gem "rack-mount":
  In Gemfile:
 开发者_运维百科   rails (= 3.0.7) depends on
      rack-mount (~> 0.6.14)

    rack-mount (0.7.2)

This is infuriating because everyone tells me that bundler is so awesome but all it's done is make it literally impossible for me to run the version of the gem that I need to. Grr.

Anyone know how to fix this? I'm surprised I haven't found anything else on Google about this, since as it stands it's impossible to upload files using rails 3.


It seems rails version 3.0.7 depends on rack-mount version 0.6.14, try to edit gem 'rails', '3.0.x' in your Gemfile. Where x is the other version number which can be 6, 5, 4 or anything that you'll prefer to use instead of 7 then delete your Gemfile.lock and try bundle install.


You can't overwrite the Rails dependancies using bundler. If you must overwrite the Rails requirements, you should maintain your own branch.

  1. Fork Rails on github (say version 3.0.9)
  2. Check it out (via git clone)
  3. Checkout branch you want to change (git checkout --track origin/3_0_9)
  4. Make a new branch (git checkout -b 3_0_9_with_new_rack_mount)
  5. Make the change. In this case, edit actionpack/actionpack.gemspec and change 0.6.14 to 0.7.2
  6. Commit the change (git commit -am "Updated to a newer rack-mount version")
  7. Push it to your github account (git push origin 3_0_9_with_new_rack_mount)
  8. Update your Gemfile with that repository (gem 'rails', :git => "git://github.com/jevy/rails.git", :branch => "3_0_9_with_new_rack_mount" # Fixes carrierwave error)
  9. Delete your Gemfile.lock
  10. bundle install
  11. Profit $$$


Did you try deleting Gemfile.lock and running bundle install again?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜