Just a quick question using nitrous.io. Been following a tutorial on treehouse for ruby on rails, now as they use version 3.2 and I was using 4 it just was impossible to follow.
So, how do I choose which version of Nitrous.io I'm installing / targeting? I need to be using 3.2.
One quick and easy way to handle this would be to install Rails 3.2 alongside with Rails 4.
gem install rails -v 3.2
From there, you can create a new project with Rails 3.2 with the following command:
gem _3.2_ new appname
If you are working on an existing project, ensure your Gemfile is specifying gem 'rails', '3.2.0', and from there you can run bundle install to ensure all dependencies have been installed.
Related
I currently have a Rails app running on 4.2.5, and I want to use ActionCable without having to upgrade the whole thing to the Rails 5.0.0.beta3 version and risk breaking all of the other gems.
Following guides I've seen on the internet, I've tried
gem 'actioncable', github: 'rails/actioncable'
which doesn't work because the ActionCable repo has been merged into the Rails repo. I even tried
gem 'actioncable', github: 'rails/rails'
but this doesn't seem to work of the re-numbering of the versions that happened when ActionCable merged into Rails. (The only version below 5.0.0.beta* is the 0.0.0, which seems to be an empty gem.)
I also tried setting the source to rubygems.org in hopes of finding an older pre-merged version, but was unsuccessful.
What can I do to integrate ActionCable into my 4.2.5 project without upgrading to Rails 5?
Conversely, when could we anticipate the first stable release of Rails 5? :)
You can have both GemSets, so you can use rails 4 and rails 5 whenever you want.
First, update the ruby gem manager by $ gem update --system, install Nokogiri if you haven't $ gem install nokogiri.
Now lets set your rails 4 GemSet (you might have to update ruby, it will tell you if you need to)
$ rvm use ruby-2.3.0#rails4.2 --create
$ gem install rails --version=4.2.5
$ rails -v
your rails version should be 4.2.5 at this point.
Now lets set your rails 5 GemSet
$ rvm use ruby-2.3.0#rails5.0 --create
$ gem install rails --pre
$ rails -v
your rails version should be 5 beta3 at this point.
We are done, now you only need to change between GemSets, depending on your needs, by doing this.
for rails 4 use = $ rvm use ruby-2.3.0#rails4.2
for rails 5 use = $ rvm use ruby-2.3.0#rails5.0
Now, you can use and experiment rails 5 without risking your rails 4 gems and stuff.
You can do exactly the same for other Rails versions if you want.
I have same issue,But i solved.just check this
Just try your rails console
check your rails version rails -v
may be rails (4.2.7.1)
Then you need to check gem list, i mean gem list -l
Now you can see your all gem with versions.
Then you need to instsll gem install rails -v 5.0.0beta2
once installed rails check gem list, gem list -l
Then you can see rails (5.0.0.rc2, 5.0.0.beta2, 4.2.7.1)
You successfully installed rails 5.0.0
Then you do bundle update
Update all gem and supporting rails 5.0.0,this is work for me just try this.
Hi I'm following Rails Tutorial using Cloud9 ...
Tutorial says to install Rails 4.2.2. Before I did, I ran "rails -v" and saw that it was 4.2.1.
I ran Gem install Rails 4.2.2 and a load of stuff was installed. Tutoral then said to execute Rails 4.2.2 New MyApp. I decided to see what would happen if I did Rails 4.2.1 New Myapp, expecting an error (since 4.2.2 is installed and not 4.2.1 [I think] ), only to get successful execution.
Why is this? Thanks.
Because that version is available in your default gem set which is associated to the Ruby version you are using. Run gem list rails and it will list the rails versions that you have. Try running rails _4.2.3_ new myApp but instead of _4.2.3_ use a version not listed and you will get an error,Could not find 'railties' (= x.x.x) If you install the rails version with gem install rails -v x.x.x you will have that rails version available for that ruby version. Also if you cd to your application and run rails -v it will output the rails version of that one application.
I need to install redmine1.4 for that need to have my rails version2.3, but I have rails3 .
How can I downgrade my rails version -> Rails 2.3.14. Thanks
I not sure I get the question. From what I understand you want to install Redmine which requires rails 2.3.x but you have rails 3 gem installed. I'm not familar with redmine but I think it should use bundler and simple bundle install should do the trick.
If not, the simplest solution would be to uninstall rails 3 gem and install rails 2.3.x gem. For that you need to:
$ gem uninstall rails
$ gem install rails --version "2.3.14"
However this may broke your other apps which use rails 3.x ver. Thus I recommend using one of following tools for managing ruby versions and use feature called gemsets:
RVM
rbenv
I am newbie to Rails development and working with Spree Commerce bitnami Stack VM instance. I am trying to install spree extension and the instructions says to make configuration changes to application Gem file which I cannot find in the webserver directory
Running Rails 2.3.5
Spree 0.9.4 version
The reason why you can't find it because Gemfile is a standard from Rails 3+ and you're using a Rails2 app. Rails3 uses Bundler which takes cares about all Gems for your app.
In Rails 2 gem dependency definition is different. It doesn't have Bundler so "bundle install" also won't work in your case.
Instead you need to add Gem dependency to config/environment.rb like this:
config.gem 'your_gem_name_here'
also you need to install the Gem manually, so not like in Rails3 where Bundler installs it. Use this in shell:
gem install your_gem_name
In general it's a good idea to update the app to Rails3, I'd recommend it because as I saw this Gem you wanna use doesn't have earlier release.
I am following a Ruby on Rails tutorial in a book that uses Acts As Authenticated, but this seems to no longer be supported. I was searching and came across a SO post which recommends a couple of different alternatives for doing user authentication in rails applications. I think AuthLogic looks like a good choice. I am using Rails 2.3.5 and Ruby 1.8.7.
The AuthLogic readme section states the following:
** Please note the latest version is compatible with rails 3 only. Rails 2
should use version 2.X.X **
However, when scrolling down to the section about installing as gem or plugin, it only gives the following examples:
Rails 3:
$ sudo gem install authlogic
Rails 2:
$ sudo gem install authlogic
--version=2.1.6
Or install as a plugin:
script/plugin install
git://github.com/binarylogic/authlogic.git
I want to install a plugin, rather than the gem, but I need to do it for 2.3.5, not for 3. Can I install the plugin by version in the same way that it shows how to install the gem by version? For example:
script/plugin install git://github.com/binarylogic/authlogic.git --version=2.3.5
If this is not how it is done, could someone please explain to me how to do it?
Thanks!
I really would reconsider using as a plugin and instead setup bundler in your project. Your Gemfile line would be gem 'authlogic', '2.1.6'. If you are concerned about packaging libraries with your project you can bundle pack to include your gems with your project.
Anyway, The following plugin install command should work.
script/plugin install git://github.com/binarylogic/authlogic.git -r 'tag v2.1.6'
Installing rails 2.3.5
Create the gemset:rvm gemset create rails2
2.Setting up rvm to use always this gemset:rvm use 1.8.7#rails2 –default
Gem install rails -v 2.3.5