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
Related
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 trying to build ROR application for which I wrote rails fist_app command in terminal. I didn't find gemfile in folder fist_app. When goggled, found Stackoverflow answer for this problem which suggest to update rails.
But when I update rails version it shows nothing to update. Here is a screen-shot.
Please suggest some solution for this problem. Thanks
You have rails installed as Ubuntu package, not as a gem, so you can't update it. Uninstall the rails package (sudo apt-get remove rails) and then install it again as a gem: gem install rails.
UPDATE: I'm not 100% sure it will work though, because gem is also installed as Ubuntu package. It's better to set up everything (ruby, gem and rails) through RVM. Here's a tutorial: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/
I am working on a project that requires me to install Rails 2.3.4. I have only worked with Rails 3 applications, where I installed Rails 3 using RVM.
Since I am using a separate machine for this project, basically all I am asking for is how to install Rails 2.3.4. Any links would be much appreciated :)
did you try
sudo gem install rails -v=2.3.4
RVM http://beginrescueend.com/rvm/install/ is your best bet.
Which OS are you working with ?
The installation guide is for Linux. I don't have much experience with RVM on windows. But should be straightforward.
With RVM you get create gemsets which will give you advantage that you can run different rails version for different applications.
http://beginrescueend.com/gemsets/
gem install rails -v 2.3.4
gem install --help for more information.
There is no reason why the above can not be executed via rvm.
gem install -v=2.3.4 rails
or
sudo gem install -v=2.3.4 rails
It will install rails 2.3.4 version.
I am completely new to Ruby and need to use Ruby on Rails 2.3.5 on Windows. I have downloaded the zip from GitHub here: https://github.com/rails/rails/tree/v2.3.5
There was no gem file so I tried rake in the extracted directory. It took ages and seemed to have a lot of errors, but it did eventually complete.
There was no gem file created (is this even what rake is supposed to do?). And rails is not installed (typing rails at the command prompt doesnt work).
Any ideas what I am doing wrong?
EDIT: I cannot use gem install rails -v "2.3.5" as I am behind a firewall. I think I need to install it from local files.
You first need to download and install Ruby 1.8.7.
You can then install Rails via gem install rails -v=2.3.5
I would recommended you download the gems of Rails 2.3.5 from: http://rubygems.org/gems/rails/versions/2.3.5
You also need other dependencies, such as:
actionmailer = 2.3.5
actionpack = 2.3.5
activerecord = 2.3.5
activeresource = 2.3.5
activesupport = 2.3.5
rake >= 0.8.3
Since you do not have an direct internet connection, you need to download them by hand.
After you download them, use "gem install xxx.gem" to install
install ruby, include gems support.
at the command line
gem install rails
Do not install instant rails, as it is outdated and unmaintained. Use RailsInstaller http://railsinstaller.org/
You normally install Rails by only using gem, you only install "by hand" if it is not hosted anywhere.
Do the following steps (I suppose that ruby is installed and the gem command is working):
gem install rails -v 2.3.5
This should include all needed gems as well, and will install the rails command in your shell. However, to use it in Windows is a little bit difficult, because the installation of sqlite3 is not so easy.
If you could access outside world through a corporate proxy, you could use it's address in gem command, like this: gem install rails -v 2.3.5 -p http://corporate_proxy
Install InstantRails: http://broadcast.oreilly.com/2008/12/installing-instant-rails-on-wi.html
recently i installed rails 2.3.5 using apt-get. After installing rails 3.0.1 the version shows on as rails 2.3.5 when i type rails -v command. How to change that? or can i update rails 2.3.5 to 3.0.1? pls help me out
You should NOT use apt to manage your rubies or your gems! (NEVER)
Use RVM to manage your Rubies and your gems : http://rvm.io/
Try gem uninstall rails then select version of rails gem which you want to remove.
You can follow the upgrade directions given at http://guides.rubyonrails.org/3_0_release_notes.html
to install Rails 3 use this script..
sudo gem install rails --pre
It's possible to control version of Rails
rails _2.3.8_ --version
rails _3.0.0.rc_ --version
Hope it'll work. For more details https://help.ubuntu.com/community/RubyOnRails#Installing_rails it's a best url
Oh, I got another solution. Try this script, it'll work
sudo gem install -v=3.0.1 rails --include-dependencies