但是这个宝石已经出现了。
我也有这个路径的插件: - / home / techvant / rails_app / techease / vendor / plugins / haml / init.rb
此init文件包含以下代码: -
begin
require File.join(File.dirname(__FILE__), 'lib', 'haml') # From here
rescue LoadError
require 'haml' # From gem
end
我需要解决此错误,请帮忙。
以下是错误跟踪。
/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require': no such file to load -- haml (MissingSourceFile) from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' 来自/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:inrequire' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in
new_constants_in' 来自/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:inrequire' from /home/techvant/rails_app/techease/vendor/plugins/haml/init.rb:4:in
evaluate_init_rb' 来自/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:146:inevaluate_init_rb' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/reporting.rb:11:in
silence_warnings' 来自/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:142:inevaluate_init_rb' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:48:in
load' 来自/home/techvant/rails_app/techease/config/../vendor/plugins/siteninja/engines/lib/engines/plugin.rb:77:inload' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:38:in
load_plugins' 来自/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:ineach' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in
load_plugins' 来自/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:348:inload_plugins' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:163:in
进程' 来自/usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:insend' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in
run' 来自/home/techvant/rails_app/techease/config/environment.rb:9 来自/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:ingem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
require' 来自/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:inrequire' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in
new_constants_in' 来自/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:inrequire' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.2/lib/commands/server.rb:84 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in
gem_original_require' 来自/usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in`requiren' 来自脚本/服务器:3
答案 0 :(得分:1)
由于haml是一个宝石,我将它放在environment.rb:
中config.gem 'haml'
然后,解压缩并将其添加到repo:
rake gems:install
rake gems:unpack
最后,删除你已经获得的haml插件引用。
答案 1 :(得分:0)
尝试:
gem update rails
...在服务器上,而不是您的开发机器
答案 2 :(得分:0)
您可以尝试解压缩宝石,使它们位于您的rails应用目录中,这将取消您的rails应用程序取决于您系统中的本地宝石。干杯!
答案 3 :(得分:0)
我也遇到了很多问题。以下是我最终解决它的步骤。
首先,安装gem。
把
config.gem 'haml'
在environment.rb文件中。我实际上不得不把它放在我的环境/ development.rb和environments / production.rb(等)中,因为它抱怨不知道rails_env。哪个不是最优的,但它有效。 然后运行
rake gems:install
然后
mkdir -p /vendor/plugins/haml
cp vendor/gems/haml-2.2.0/init.rb /vendor/plugins/haml/init.rb
然后重新启动rails服务器。