i'm new user here. and this is my first question regarding Ruby on Rails. so, i wanted to ask what is the correct program version of Ruby on Rails, i have seen only 2.1 and 2.2.
i was looking for 5.0 to install and use it for first time. i chose RoR (nickname for Ruby on Rails) to create a website that can have many useful features like a site would do. but i'm at loss because i have no idea where i could find a RoR 5.0 or should i just install a older package of RoR to update to 5.0?
also, i have additional questions.
1: is RoR a program that can help you make website or blog, forum? or it's just a one in all package?
2: can you actually put together a section inside a site for news information/updates?
3: where do you find or make a code for mailing list which users can have a mail updates sent to their email?
these are my questions, you see i'm quite fond of a site that is run on RoR. so i'd like to try my hand on creating a site of my own, particularly one with a forum. like any kind of development, it's fun to learn. will you answer my questions and help me learn the program of Ruby on Rails?
Ruby is a programming language which has it's own version number. Rails is a library written in Ruby which has it's own version number as well.
The version of Ruby is not the same as the version of Rails. Rails 5.x requires Ruby version 2.2.2 or higher.
You can view the versions of each by using
$ ruby --version
$ rails --version
You can use the latest stable version of Ruby. – get it from here: https://www.ruby-lang.org/en/downloads/ (The current latest stable is 2.3.1)
To get the latest version of Rails, use the gem install command. (The current latest stable version is 5.0.0.1)
$ gem install rails
Related
I have a huge rails web application with wide user base which runs on Rails 4.2.2 and Ruby 2.2.2 as of now. I simply want to upgrade the whole application to the latest version of Ruby i.e. 2.5.0 and Rails 6.0.2.2.
The reason for upgrade being I want to integrate a completely separate React.js frontend and a separate Rails backend. Other reasons for upgradation being deprecating older version of gems and rails.
I have tried researching a lot for this. I have also tried the : https://guides.rubyonrails.org/upgrading_ruby_on_rails.html guides. But everything out there is so vague and haphazard. I havent found any clear cut method until now following which I can upgrade my rails application smoothly.
Please help.
What i would recommend you to do is to upgrade to Rails 5.x.x first and than to 6.x.x you can use those guides and follow step by step:
https://www.ombulabs.com/blog/rails/upgrades/upgrade-rails-from-4-2-to-5-0.html
https://selleo.com/blog/how-to-upgrade-to-rails-6
I would recommend a progressive update for both Ruby and Rails. I would for example start by updating Ruby from 2.2.2 to 2.3, using the Release notes as guide of what things have changed:
https://www.ruby-lang.org/en/news/2015/12/25/ruby-2-3-0-released
Once that work (which would be easy to check if you have high test coverage), I would continue with Ruby 2.4 and so on.
Ruby minor releases (for example 2.2.2 to 2.2.3) shouldn't include breakable changes, so you can just go from 2.2.2 to 2.3, 2.4, 2.5 ...
Also, note that the last version Ruby is 2.7.1 and not 2.5.0. Another good reason to update your Ruby version is that it is not maintained any more and it does not receives security fixes. 2.5.8 is in security maintenance phase, which means that it won't be maintained anymore soon. You may want to update to at least Ruby 2.6.
Regarding Rails, you can find the release notes here: https://guides.rubyonrails.org/5_0_release_notes.html (just change the number in url to get the information of a different release).
I have a pretty general question regarding Jekyll. When I try to install it on my mac I get an error saying I don't have write permissions to the ruby directory. After looking around online I've found that you can fix this by installing a ruby version manager. My question is why does this work? Is Jekyll essentially an extended version of Ruby? How are they related architecturally?
Thanks!
I think Jekyll is a Ruby Gem. So that would mean it is written in Ruby, and needs the Ruby interpreter on your system to install/run it.
RVM is just a tool to help you manage your different Ruby versions (because you could potentially install multiple versions at the same time, for different users for example).
Jekyll is built in Ruby and is available as rubygem. That's why it requires Ruby to build. It provides command line interface to carry out deploy and other operations and provides minimalistic HTTP server.
It is also equipped to convert markdown to HTML using redcarpet ruby gem.
It's AWESOME.
First of all, I think it isn't a prohibited question on StackOverflow since it's a precise question about environment, an objective question. But if it's prohibited, please tell me.
Currently I'm developing a specific project that is using Ruby 1.9.3 and Rails 3.2.3, at the moment we can't upgrade to Rails 4 because the project dependencies.
My question is:
Using Rails 3.2.3, we can upgrade to a newest Ruby version? If so, what version: Ruby 2.0, Ruby 2.1.2 or another one?
Also, I searched on Google and StackOverflow and I don't find a question like that.
Thanks!
The first release of rails that officially support ruby 2.0 was 3.2.13 (see the announcement on the rails blog.
I deployed several applications running 3.2.15-3.2.17 and ruby 2.0 (They've since been upgraded to rails 4) without any problems that I recall.
The recently released 3.2.22 supports ruby 2.2 (announcement)
According to the Travis configuration, Rails 3.2.3 was only tested with Ruby 1.8.7, 1.9.2 and 1.9.3, so it doesn't seem to be a good idea to use a later version of Ruby (but you can always test it yourself.) However, Rails 3.2.3 has some known security vulnerabilities that have been patched in 3.2.19.
On the other hand, the configuration for Rails 3.2.19 does suggest that the developers expect it to work with Ruby 2.0.0. Your project might benefit from investing some effort to see if you can upgrade from Rails 3.2.3 to 3.2.19, and test a combination of that with Ruby 2.0 for your application, if there are new Ruby features that you need and cannot efficiently backport them. Bear in mind that the only recent answer to a similar question warns of 'weird issues' from such a combination. Also consider that the latest Rails 3.2 release notes do not mention Ruby 2.0.
I'm on a Windows 7 computer, I'm the admin. I keep searching for a guide or tutorial to help, but nothing has popped up.
I installed Ruby 2.0 on my computer last night, then realized that 4.0 has come. Do I need to uninstall it for Rails to work? I'm relatively new to this and am confused. Any links to anything would surely help.
Thank you all in advance.
Ruby 2.0 is the most recent version of Ruby, a programming language. Rails 4.0 is the most recent version of Rails, a web app framework for Ruby which is actually designed with Ruby 2.0 in mind. You install Rails 4.0 just like every other version of Rails: gem install rails.
I'm learning Ruby on Rails with the AWDR book and have had to be specific about which version of Rails and Ruby that I am running on my local machine. I have just discovered that I need to roll back from ruby 1.8.7 to ruby 1.8.6 here. I also needed to roll back Rails to support the scaffold method so I could start the tutorial easily.
My question is: When I start contracting, developing and deploying projects in the real world, how am I going to manage all these different versions?
It looks to me like Rail's low tolerance for legacy code negates its ease of use philosophy! But I'm sure I'll grow to appreciate RoR.
As for Rails, What you can do is freezing your version, for example:
Make sure to install the proper Rails version, suppose you want version 2.2.2 : gem install rails v=2.2.2
Freeze and pack Rails with the project itself : rake rails:freeze:edge RELEASE=2.2.2
Now you will find Rails packed inside the vendor folder of your project, so you don't have to install Rails on the deploying machine.
And for Ruby, I like Ruby Version Manager(RVM), the easiest way to manage Ruby versions.
RubyGems is Ruby's package manager. You can install as many versions of gems (packages) as you want. You can install the latest by running sudo gem install rails (at the moment it will install 2.3.5). If you need 2.2.2, specify that with the -v or --version option: sudo gem install rails --version 2.2.2. Rails also installs a binary (yes, I know it's not really a binary file), rails, which generates a project. Because you have several versions of the gem, you need to control which binary gets called. When you install the rails gem, RubyGems puts a file in it's bin/ dir, which is a "link" to the real rails binary. That is the one you "call" when you say rails on the command line. However, all of the rubygems "link" binaries accept a parameter of it's own, which is what version you want to use. You would use the 2.2.2 rails binary like this:
rails _2.2.2_ my_project
I think the default is to use the most recent version, so if you want to use the most recent version, do this:
rails myproject
However, I see that you use 2.2.2 to get access to the scaffold method. I would strongly suggest you not to use that method, there's a reason for removing it. The scaffold method hides code, and makes customization hard. Instead, use the scaffold generator:
./script/generate scaffold --help
Good luck on your future rails adventures!
The latest version of Agile Web is written for 2.2.2 I believe. For this basic app they walk you through I'm very certain it should work with 2.3.x
The answer to the question for how you keep up is that you update your apps as needed and read the api and Changleogs to find out what has changed and fix the stuff that upgrades break. A great way to help with this is having a good test suite with good test coverage.