简体   繁体   English

已安装Rails gem,但无法正常工作

[英]Rails gems installed but not functional

I'm using Rails 3.2.13, but I don't know what's wrong with it. 我正在使用Rails 3.2.13,但我不知道它有什么问题。 For some reasons, every gem I tried installing recently were successfully installed (as the log reads 'Your bundle is complete!') 由于某些原因,我最近尝试安装的每个gem都已成功安装(因为日志显示“您的捆绑包已完成!”)

But the problem comes when I tried using the gems, they don't seem to be available! 但是问题出在我尝试使用宝石时,它们似乎不可用!

some of the gems I tried using: - best_in_place - rails-bootstrap-toggle-buttons and other gems as well. 我尝试使用的一些宝石:-best_in_place-rails-bootstrap-toggle-buttons和其他宝石。

None of them worked properly, and for instance, the best_in_place gem gives me the following error 它们都无法正常工作,例如,best_in_place gem给我以下错误

undefined method `best_in_place' for #<#:0x52efc18> #<#:0x52efc18>的未定义方法`best_in_place'

And in gems where I need to specify 'require [gem_name]', I got errors like 在需要指定'require [gem_name]'的gems中,出现类似

cannot find [gem_name] 找不到[gem_name]

This has been very frustrating to me, please help out, and let me know if there is any more information I should provide. 这让我感到非常沮丧,请帮忙,如果需要提供更多信息,请告诉我。 Thanks! 谢谢!

At the top of your source file you need: 在源文件的顶部,您需要:

require 'name_of_gem'

for each gem you want to use. 对于您要使用的每个宝石。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Rails外部JS作为宝石 - Rails external JS as gems Rails 3.1和Jasmine:包括来自gem的JavaScripts - Rails 3.1 & Jasmine: Including JavaScripts from gems JavaScript在Rails中不起作用-导致删除路径不起作用,以及一些宝石 - JavaScript not working in Rails — Causing delete path not to work, and some gems Forms 和 Rails 3 中的表单验证:构建自己的 vs Formtastic vs SimpleForm vs 其他 gem? - Forms and form validation in Rails 3: build your own vs Formtastic vs SimpleForm vs other gems? Rails功能测试assert_select javascript react_to - Rails Functional test assert_select javascript respond_to 在Rails中,您如何对Javascript响应格式进行功能测试? - In Rails, how do you functional test a Javascript response format? 无法在RedHat中安装/识别Javascript运行时(对于Rails 3.1) - Can't Get a Javascript Runtime Installed/Recognized in RedHat (for Rails 3.1) 在heroku上托管的Rails应用程序表示未安装Google Analytics - Rails app hosted on heroku says Google Analytics is not installed javascript仅在页面重新加载时有效(已安装rails,turbolinks) - javascript only works on page reload (rails, turbolinks installed) 我已经安装了 webpacker,但是 rails 无法识别 javascript 代码 - I have installed webpacker and but rails won't recognise javascript code
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM