More specifically for my purposes, I would like to know how to find out in the case when there is no gemfile (I'm relatively new to rails and used to seeing the rails version in the gemfile with all the rails 3 apps, but am not sure for older versions.)
With an open rails console (for example, if you are on the server that runs the application) you could call Rails.version or Rails.gem_version for a short info or Rails::Info for a more complete overview about your environment.
If you are using bundler, a more up to date way to do this than bundle show rails is bundle info rails or bundle info [gem-name-here]. This will print version, summary of gem's purpose, link for gem project (if it exists), and your local path for the gem. Super convenient.
For some Rails versions, the required Ruby version is mentioned in the Release Notes. (I really cannot understand why something fundamental like the minimum Ruby version required is not listed in each and every Release Note or in some dedicated documentation page?!)
I suggest you open a Documentation PR for this. Document your findings. Someone from the Rails core team will review. This is the best way to confirm your understanding is right and also contribute to the documentation of Rails. You can learn from the best.
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Apologies for the long winded questions but I would really appreciate itif someone with experiance with ruby on rails could help me out.Broadly I tried to group my questions into 3 parts. Sorry I know Part 3 is quite a few qestions, but I felt they were connected so I left them together. Thanks for your help in advance.
3) Since the code varies somewhat for the different versions of rails how will I learn a cohesive version of the language? Since the older Ruby on rails project treebook uses a different version of rails does it mean that I can't learn those tutorials? If I can still do those tutorials on a current version of railsHow would I do that? Does this mean that everytime that a new version of railsis released I have to go relearn it?
You can install different versions of rails using the gem install rails -v 4.0.1 command, just as you wrote. When you do, from now on you can use that version for generating new applications that would use specific versions, the proper command is rails _4.0.1_ new odot (notice the underscores). You can try upgrading and downgrading Rails version in your project's gemfile and then running bundle update, but this might not be enough and some additional manual work could be required.
Rails is not a language - it's a framework that uses Ruby language. Ruby does not change that much from version to version, although differences are noticeable between major releases, like between 1.9 and 2.0. But Rails as a framework changes quite often and sometimes those differences are big (like the introduction of Strong Parameters by default in Rails 4, which makes it impossible to follow treebook videos with Rails above v3.2).
You have to learn to keep up with changes and adapt if you want to be a developer. You should learn both v3 and v4 (so go through ODOT and treebook apps), because in the future you might be asked to work with an older app that someone else wrote or even upgrade an app from older version of Rails to a newer one, so it would be good to know the differences and how things are done in those praticular versions. You will get used to it and it's not as crazy as you might think, Rails is quite established today, so changes don't tend to be that dramatic. You want crazy? I hear it's hard to keep up with Node.js and other hot, new JS frameworks, because they change a lot ;).
You can do both ODOT and treebook, just make sure you're using the proper version of Rails while generating the app or use pre-generated virtual machines from treehouse that have all the proper versions installed for each project.
Also, my personal comment: Windows is not the best choice for Rails development. I tried this for a few months, but it was painful sometimes. In the long run you should consider a Linux or Mac machine, or at least a virtual machine with Linux on your Windows.
when I install rails v4.0.1 (while I already have v4.1.4 installed) will thatoverride the the version that I have installed? Or will it be like thereare 2 seperate versions of rails installed (v4.0.1 and v4.1.4, where v4.1.4 would be the dominant one) and when I install v4.0.1 it's there but to useit I have to do 'rails_4.0.1_new odot'?
How do I learn to compensate for the differences bwtween the versions so that using ruby 2.0 and rails 4.0.1 I can make somethings similar to treebook? I guess what I'm trying to say is how do I bridge that gap in knowledge (and also learn about the changes that occur from using different versions of ruby and rails) so that what I learn in the tree book project will be applicable to all the other projects I do as a rails developer? I hope what I'm asking makes sense to you.
I think you'd have to experiment, because I'm no sure how this would work under Windows (I use Linux with Ruby Version Manager, so it's a completely different situation). Install another version of Rails and then generate a new app normally (without specifying any version) and then see the Gemfile - it will show the version of Rails used.
Treebook should work fine with Ruby 2.0.0 and you would need some additional software to have different concurrent installations of Ruby running (in Windows that software is Pik, no idea how t use it).
The only way to learn those differences is by trial and error I'm afraid. Most people on Treehouse learn it the hard and frustrating way - by doing Treebook not knowing that there are differences and getting tons of errors...the most important one is Strong Parameters, which become more complex with Devise.
As for the virtual machines - Treehouse has videos about setting up a development environment, including videos on how to use their virtual machines. I never used them, so I can't really help you there, you need to try for yourself. Personally I use VMWare Player with Ubuntu, but there are no videos for that on Treehouse.
Ruby and Rails under Windows work slower, Windows Command Line does not support most commands that are used in Linux/Mac console (so lots of manual work, even if you use emulators such as CMDER), no access to nice tools like RVM, errors that are only seen only in Windows and less helpful advice online because most developers work in Linux and Mac. These are the major problems.
This is a short post to show the compatibility between Ruby on Rails opens a new window and Ruby opens a new window across different versions. In theprocess of upgrading really old applications to more modern versions of Ruby andRails we have run into a lot of these combinations.
Andersen Hitches is proud to offer the future of 5th wheel trailer hitches. The Ultimate 5th Wheel Connection is the lightest and most affordable way to connect your 5th wheel trailer to your short bed or long bed truck. In fact, it is the best fifth wheel hitch on the market.
The ball of the Ultimate 5th Wheel Connection rides inside a greaseless coupler. That means that unlike other fifth wheel trailer hitches for short bed trucks, the Ultimate Connection eliminates dirty hands and mess! And because the coupler rides on a ball, it has more swivel in every direction than all other 5th wheel hitches available. This also gives you the ability to couple or uncouple your trailer on uneven terrain.
The ruby version I am using in my local development environment is Ruby 3.1.3 and the application runs fine on it.
However, I suspect the version being used on the virtual machine(Render production environment) is the one causing the issue and is currently version 2.6.8(see log message), which is lower than the minimum 2.7.1 version.
My render app is hosted at -f7t4.onrender.com/
Ruby on Rails' emergence in 2005 greatly influenced web app development, through innovative features such as seamless database table creations, migrations, and scaffolding of views to enable rapid application development. Ruby on Rails' influence on other web frameworks remains apparent today, with many frameworks in other languages borrowing its ideas, including Django in Python; Catalyst in Perl; Laravel, CakePHP and Yii in PHP; Grails in Groovy; Phoenix in Elixir; Play in Scala; and Sails.js in Node.js.
David Heinemeier Hansson extracted Ruby on Rails from his work on the project management tool Basecamp at the web application company 37signals.[8] Hansson first released Rails as open source in July 2004, but did not share commit rights to the project until February 2005. [citation needed] In August 2006, the framework reached a milestone when Apple announced that it would ship Ruby on Rails with Mac OS X v10.5 "Leopard",[9] which was released in October 2007.
Rails version 2.3 was released on 15 March 2009, with major new developments in templates, engines, Rack and nested model forms. Templates enable the developer to generate a skeleton application with custom gems and configurations. Engines give developers the ability to reuse application pieces complete with routes, view paths and models. The Rack web server interface and Metal allow one to write optimized pieces of code that route around Action Controller.[10]
On 23 December 2008, Merb, another web application framework, was launched, and Ruby on Rails announced it would work with the Merb project to bring "the best ideas of Merb" into Rails 3, ending the "unnecessary duplication" across both communities.[11] Merb was merged with Rails as part of the Rails 3.0 release.[12][13]
Rails 3.1 was released on 31 August 2011, featuring Reversible Database Migrations, Asset Pipeline, Streaming, jQuery as default JavaScript library and newly introduced CoffeeScript and Sass into the stack.[14]
795a8134c1