Re:Metasploit Rails 3 Remote Code Execution Hours Away
by bonzoesc on Wednesday January 09, 2013 @11:56PM
(#5035519)
You'll need to change the version of rails listed in the Gemfile. I don't think "bundle update" modifies that.
[ Parent
| on HN ]
Re:Metasploit Rails 3 Remote Code Execution Hours Away
by lengarvey on Thursday January 10, 2013 @12:13AM
(#5035584)
Actually it depends on what your Gemfile looks like. If you've specified the exact version in your Gemfile you'll need to edit it before running `bundle update rails`. This means your Gemfile might look like:
gem 'rails', '3.2.10'
Running `bundle update rails` when you've absolutely specified the version number won't do anything. Your Gemfile.lock file (which is the file that bundler uses to determine which gems to require) won't be changed. Instead of absolutely specifying the version of Rails you want to use, considering using the '~>' specifier. My Gemfile at Airtasker looks like: gem 'rails', '~> 3.2.8'
That means that when I run `bundle update rails` it will update the patch version of rails. Our Gemfile.lock has the following entry for rails: rails (3.2.11)
By using the '~>' specifier it means that we can easily update our gems patch versions without worrying about API changes between major and minor versions.You can read: http://gembundler.com/v1.2/gemfile.html to find out more.
Re:Metasploit Rails 3 Remote Code Execution Hours Away
by dasil003 on Thursday January 10, 2013 @04:21AM
(#5036127)
For completeness it's also worth mentioning that gem 'rails', '~> 3.2.0' may not necessarily update Rails to the latest version when you run `bundle update rails`. The reason is if there is another gem which requires a gem that does not match the requirement of the latest version of Rails, it will backtrack until it finds a compatible version across the board.
So you will want to double-check the specific version that you end up with. If it doesn't work you probably can fix it with `bundle update rails something_else`, unless you have a true conflict in which case you will have to do some spelunking yourself, and perhaps the Rails hotfix should be in place in your app first.
Re:Metasploit Rails 3 Remote Code Execution Hours Away
by INTPenis on Thursday January 10, 2013 @02:03AM
(#5035881)
Thank you, in fact I had the 3.1.2 version specified in my Gemfile. So I changed that to 3.1.10 and now bundle show rails shows that version as installed so I think I'm in the clear.
Re:Metasploit Rails 3 Remote Code Execution Hours Away
by bonzoesc on Thursday January 10, 2013 @02:05AM
(#5035884)
You may want to change it to a less-specific version so future patches (and they are coming) are less work to apply.
Re:Metasploit Rails 3 Remote Code Execution Hours Away
by outside1234 on Thursday January 10, 2013 @12:03AM
(#5035547)
That's exactly what bundle update does.
Re:Metasploit Rails 3 Remote Code Execution Hours Away
by guywithabike on Thursday January 10, 2013 @12:14AM
(#5035588)
Only in Gemfile.lock. If you've hard-coded a version in Gemfile, you'll need to update it.
Eg. These will update fine:
gem "rails"
gem "rails", "~> 3.2"
This wont: gem "rails", "= 3.2.10"
Re:Metasploit Rails 3 Remote Code Execution Hours Away
by jaggederest on Thursday January 10, 2013 @12:21AM
(#5035607)
No, bundle update only updates the Gemfile.lock
If your gemfile looks like:
gem 'rails', '3.2.10'
Then `bundle update` does nothing.