如何为rails 2.3.5安装AuthLogic插件?
我正在阅读一本使用 Acts As Authenticated 的书中的 Ruby on Rails 教程,但这似乎不再受支持。我正在搜索并发现了 SO 帖子,其中推荐了在 Rails 应用程序中进行用户身份验证的几种不同替代方案。我认为 AuthLogic 看起来是一个不错的选择。我正在使用 Rails 2.3.5 和 Ruby 1.8.7。
AuthLogic 自述文件部分说明以下内容:
** 请注意,最新版本仅与 Rails 3 兼容。铁轨2 应使用版本 2.XX **
但是,当向下滚动到有关安装为 gem 或插件的部分时,它仅给出以下示例:
轨道 3:
$ sudo gem install authlogic
轨道 2:
$ sudo gem 安装 authlogic --版本=2.1.6
或者作为插件安装:
脚本/插件安装 git://github.com/binarylogic/authlogic.git
我想安装一个插件,而不是 gem,但我需要为 2.3.5 执行此操作,而不是 3。我可以按版本安装插件吗?它显示如何按版本安装 gem 的方式?例如:
脚本/插件安装git://github.com/binarylogic/authlogic.git --version=2.3.5
如果不是这样做的,有人可以向我解释一下该怎么做吗?
谢谢!
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.6Or 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我真的会重新考虑将其用作插件,并在您的项目中设置捆绑器。您的 Gemfile 行将是
gem 'authlogic', '2.1.6'
。如果您担心将库打包到您的项目中,您可以捆绑包
以将您的 gems 包含在您的项目中。无论如何,以下插件安装命令应该可以工作。
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 canbundle pack
to include your gems with your project.Anyway, The following plugin install command should work.
安装导轨2.3.5
2.设置rvm总是使用这个gemset:rvm use 1.8.7@rails2 –default
Installing rails 2.3.5
2.Setting up rvm to use always this gemset:rvm use 1.8.7@rails2 –default