How to get a rails commit into my gemmed version - ruby-on-rails

Rails 2.3 was released last week and I installed it with gem install rails. Everything is working fine. However, I noticed a bug, so I searched a bit and sure enough a new commit was accepted 2 days ago that fixes the same bug I saw.
How can I get these latest changes into my version of rails that I'm running locally?
I tried gem update rails --include-dependencies but it doesn't update rails (as I assume because I already have the latest gem 2.3.2). So, how can I get the last few commits into my version of rails?
Thanks.

I've never used Edge Rails but I imagine that's what you'd need to do. Edge is the last commit and may have other bugs in it.
If the changes are small, just edit the code. Once you've done that you may be able to freeze the gems after you've edited them, but I'm not sure that freeze will freeze the rails code itself. If it does then everything should still work fine, otherwise you'd also need to edit it on your production gems too.
Hope this helps, doubtless some Rails Edge god will come along and tell us the easy way.

If you use git to checkout the release, then you can use git cherry-pick to grab the specific patches that you want for your own personal tree. google for git cherry-pick for more info (and if you aren't familiar with git, it's worth learning!)

I found some comprehensive instructions for this here:
http://www.napcsweb.com/blog/2008/04/24/create-a-new-edge-rails-project

If you freeze rails to the 2.3.2 version, you can then edit the file yourself and be sure that your application will use that edited version of rails.

Related

does it possile rails declare gem should update automatically?

I have a rails project that have alot of gems, whitch works on server, few days ago I decide to update my project to latest version of rails and gems then I found some gems in my project depricated and I have to refactore my code.
Then i found does it possilbe to change some configuretions in my rails project to declare me when should I update gems in gemfiles or i have to check my gemfile manually to be sure my project up to date?
I google my idea but nothings found useful witch can help me
Not sure this is possible by rails configuration. rails or gems used will usually log deprecated messages if they intend to deprecate any feature.
however, there are other free apps that can do similar things like https://depfu.com/ which will depend on how you set your configuration, open a PR with gems that need updates
there is also https://dependabot.com/ by Github which also has the power (if your project is on any git platform) to show you messages on which gem needs a security update or is being deprecated in the security tab

Upgrading bootstrap-sass from v2.3.2.0 to v3.0.2.1 breaks sample_app CSS

Working through Hartl's sample_app tutorial...not an issue with the tutorial, but with my own tinkering. Wondering if someone smarter than me can help us all out... I know that often times updating gems can bork your app(s), so I was prepared for this (hooray for committing often!), but when I saw that the bootstrap-sass gem I was using was out-of-date, I had to update.
Before the update, I was using v2.3.2.0 - no ill side effects.
After the update, the gem version was 3.0.2.1 and certain sass variables had changed, which was an easy fix (namely cameCase to non-camel-case). This was easily identified and fixed by running the rspec tests written to this point in the tutorial.
What's throwing me through the loop is now the right top menu links (home, help, sign in) look stacked like a "normal" un-styled un-ordered list. Correspondingly, this is causing the top bar to triple in size, and thus cover some of the text seen in the main content area.
I'm not a talented enough front-end guy to know exactly what is going on, but have tried to describe it as best as I can here. I can point you to the git commit compare here, but even this is a lot to take in.
In the meantime, I've reverted to v2.3.2.0 and all is back to how it was. Lesson learned, sniff out changes and test-test-test before blindly updating gems.
Thanks in advance for any and all help!
P.S. I also have posted this in the /r/Learn_Rails subreddit here.
For a list of what is different between BS 2.x and 3.x see this link: http://getbootstrap.com/getting-started/#migration
If you want to use the latest BS version, you'll have to update the HTML to reflect the new class names etc.
This is happening because of the new functionality introduced in the newer version of Bootstrap(3.0) and tutorial is based on the bootstrap verison(2.3..).
So, If you are interested then see the changes made in the newer versions Click Here

Is it okay to use Rails 3.1 for a new project? Is hard to convert over?

I have just started using 3.0.7. I am about 2 weeks of development in.
I was wondering if I should keep building for 3.0.7 or switch to 3.1 before I have too much code to port over? I like most of the new features (my only fear is not having good error messages when I use coffeescript), so I'd like to code towards the latest and greatest if it's relatively safe.
The javascript standards look interesting, and the attr_accessible fix sounds like it's very much appreciated.
Is Rails 3.1 compatible with all the gems out there though?
Also, if I go the 3.1 route, is hard or easy to migrate my project towards it? How might one go about that?
I guess this is a lot of mini yet related questions. I'd really appreciate some answers. Thank you.
I think if you want to ride on Rails 3.1 you should do it :). As for me I have some projects on Rails 2.3.5, 3.0.5 and would like to port them on Rails 3.1 but there is to much code there :). So don't be afraid and go to the fresh stuff (unless your code overflow :) ).
Rails 3.1 are pretty stable for now (I didn't have much problems with installing and using it)
If you're only two weeks into a project then it makes sense to stay on the edge and move to 3.1.
The way I'd do it is clone my project to a new dir (you're using git / similar version control, right?), change the Rails version in my Gemspec, run tests and play around to see what got broken (if anything). Based on the results you can figure out whether the effort is too great.
Regarding gem compatibility, hardly anything is compatible with all gems out there. Since you're two weeks in, you probably know which gems you use. Test like I suggested and you'll have an idea whether it's compatible with what you need. If you're using popular gems, then they'll most likely be updated to work with 3.1 soon enough.

Rails 3 is out, but will they still support Rails 2.3.x?

Rails 3 is out and every one is excited (etc etc).
However, I'm not ready to update to it yet for a couple reasons:
Not all gems I use are supported.
Just finally got my head around 2.3.x.
My client expects software that is reliable.
So, right now I'm running 2.3.5 and will be upgrading to 2.3.8 soon. But what about any security patches or parallel feature updates that 3 might get? Will there be a 2.3.9? Will there be a 2.4? Does anyone know?
Looking on https://rails.lighthouseapp.com/projects/8994-ruby-on-rails there is a 2.3.10 milestone, so they will at least have that.
You can see from the commit log that there are still commits to the 2.3 branch eventhough it's not as active as the 3.x branch. 37signals are still using 2.3 on many of their apps that's why you will see many patches/commits coming from Jeremy, one of 37signals employee. I don't think they will make any major changes that will break your apps though.
Judging by the lastest commit to 2.3.9pre ("preparing for 2.3.9") and the open tickets (none), it looks like Rails 2.3.9 will be released any day now.
Actually upgrade to 3.0 doesn't break that much. There's few gotchas, but they are mostly very well documented. Most common gems are already compatibile with rails 3 (at least the newest beta versions). I am sure, that by the time you would finish upgrading all of those would have stable relases.
I would go rather for 3.0 instead of going for an upgrade in 2.3.x branch.
It is very crucial to have lots of well placed tests for your application. This way you can easily see if anything breaks.
I found much many problems after switching to Ruby 1.9.x, then after going from Rails 2.3.x to Rails 3. Actually now I am using REE 1.8.7 with Rails3.

What is Edge Rails?

What does "Edge Rails" mean? I found some hints on the interweb, but it's not clear, does it mean the latest Rails or Rails 2.2 or what?
Edge rails is the Rails master branch. It means everything up to the very newest commit.
It means the latest Rails. The newest :)
The newest one.
Edge rails may contain lots of bugs, so use it carefully.
It's the latest rails commit and everything in this commit is very much new and its not guaranteed to be stable!
Its a funride and someone might enjoy and someone might not!

Resources