Fairly new to all this, so please do excuse the novice in me. So I just purchased the full package from Michael Hartl's rails tutorial website. I am running into some issues setting up the dev environment.
I used Rails Installer to get things going, and it installed the works. The only issue here is that it installed a version of Rails newer than 4.1, to follow Hartl's tutorial I need 4.0.5. When I type in gem rails -v in the CMD, it says Rails 4.1.1.
How would I go about installing an older version, such as 4.0.5, and having only that one run, instead of 4.1.1?
I do appreciate all the help as I am very eager to get started with RoR and to follow Hartl's tutorial. He does say in the tutorial that it will not work if I am not able to install the correct versions of Rails, so I am really stuck here.
Thank-you.
edit: I am on Windows 7, and am using Sublime Text Editor 3 as well.
First install the version that you want, as others said in the comments:
gem install rails -v 4.0.5
Then just create the new project as follows:
rails _version_ new appName
Using your desired version:
rails _4.0.5_ new appName
This way the project will be created with the version specified.
Don't worry if you have more than one version of Rails installed
Related
Currently I have asdf for managing my versions of Ruby (2.6.5), nodejs, and yarn. I am trying to follow a Rails tutorial with version 5.2.1.
Running gem install rails -v 5.2.1 and
rails new appname version=5.2.1.
It still says version 6.0.2.1 application. I am new to Ruby on Rails so there could be something obvious I'm missing or I'm making a bigger deal out of this than it needs to be. But I'd like to follow this rather long tutorial as close as possible. I believe it is installing the correct version of rails under this path.
~/.asdf/installs/ruby/2.6.5/lib/ruby/gems/2.6.0/gems/rails-5.2.1/
Any help would be greatly appreciated. Medium blog ...
Try this
rails _5.2.1_ new appname
I'm using cloud9 IDE and following the rails tutorial for beginners.
Why doesn't rails_4.2.0_ new hello_app (as written in the book) work.
The only thing it says on the terminal is rails rails_4.2.0_ "command not found"?
However, when typing, rails new hello_app 4.2.0 it works. When opening the GEMFILE in the text editor I have to adjust default gems to go along with the tutorial.
Is there a different version of rails comes up?
Thanks.
Type rails -v and find out what version you have. You can also just type rails new hello app and if you have rails 4.2.0 installed then it should use that version of rails. Make sure you run bundle update if you changed your gem file.
Can you leverage the Rails Installer for MAC (From Engine Yard) to bypass Michael Hartl's set-up steps for Ruby on Rails?
It looks like by installing Rails Installer you get:
Git
RVM, including Ruby Gems
Ruby
Rails
I have already downloaded Sublime Text. Just wanted to make sure that there are no unintended consequences of downloading Rails Installer and then following Michael Hartl's instructions to learn how to build an app. Thank you!
Possibly, but I wouldn't take that chance.
All-in-one type of installers are convenient, but Rails development environment have complicated dependancies and the installer probably cannot cover all the possibilities.
In the long run, installing these things one by one will be easier for you to debug. And trust me, you will get some random Gem errors due to Ruby version or missing dependancies and using all-in-one installers will make it difficult to find out what dependency you did not install.
Follow the convention and install parts one by one as suggested by Hartl.
I have updated rails and have rails -v and it says 3.0.5. (which is good) when i open my old programs, will it still always use 3.0.4 as that is what was used?
And ..
when i create new one will it use 3.0.5
I have done this as i'm a newbie and having problems with tutorials from the rails by example book michael hartl and wondering if it is the version that is giving the problems.
Thanks for any help..
In Rails 3 Bundler was added to handle gem dependencies. Within each application a Gemfile exists that specifies the version of Rails to use. If you want to update an application change the version in your Gemfile and run bundle install.
i am just starting with RoR and working through some tutorials, there is however a particular piece of code on github that i would like to look at, i have cloned it to my local and cd into the project but 'rails s' does not seem to start the server - any ideas what i need to do?
That's a Rails 2.3.2 app. rails s was introduced in Rails 3, so you'll have to use the older script/server start command.
Also, you're going to need rails 2.3.2, which you can install with gem install -v=2.3.2 rails. There's also the possibility that you're missing some required gems, which you'll find out about by running the app and watching for load errors.
Also, make sure you're running Ruby 1.8.7, not Ruby 1.9.2. Rails 2.3.2 does not work with Ruby 1.9.2