乘客中丢失的宝石

发布于 2024-10-20 15:27:02 字数 868 浏览 3 评论 0原文

我的 Rails 2.3.8 应用程序无法启动,因为缺少 gem:Friendly_id。我收到以下错误消息:

Missing these required gems: friendly_id ~> 3.2.1 You're running: ruby 1.8.7.253 at /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby rubygems 1.3.7 at /home/development/.gem/ruby/1.8, /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8 Run `rake gems:install` to install the missing gems. 

其中 development 是我运行该应用程序的用户。

我发现在本地 /usr/lib/ruby/gems/1.8/gems 中,我可以使用 sudo gem installFriendly_id 命令将 gem 安装到此目录中。

但我注意到,在 Passenger 从以下位置检索 gem 的路径中: /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems 没有 Friendly_id 宝石。不过,如果没有 sudo,我就无法运行该命令。

现在我知道我必须将 Friendly_id gem 安装到 /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems 目录中,但是我不知道怎么办。

谢谢。

My Rails 2.3.8 app couldn't startup because of a missing gem: friendly_id. I got the following error message:

Missing these required gems: friendly_id ~> 3.2.1 You're running: ruby 1.8.7.253 at /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby rubygems 1.3.7 at /home/development/.gem/ruby/1.8, /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8 Run `rake gems:install` to install the missing gems. 

where development is the user I am running the app.

I found that in my local /usr/lib/ruby/gems/1.8/gems I was able to install the gem into this directory using the sudo gem install friendly_id command.

But I noticed that in the path for Passenger to retrieve the gem from: /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems does not have the friendly_id gem. I couldn't run the command without sudo though.

Now I know I gotta install the friendly_id gem into the /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems directory, but I couldn't figure out how.

Thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不寐倦长更 2024-10-27 15:27:02

我设法使用以下命令将丢失的 gem 安装到所需的目录中:

sudo /opt/ruby-enterprise-1.8.7-2010.02/bin/gem install <<<gem-name-here>>>

I managed to install missing gem into the required directory using this command:

sudo /opt/ruby-enterprise-1.8.7-2010.02/bin/gem install <<<gem-name-here>>>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文