apache2 - Require ruby gems in rails controller -
require 'rubygems' require 'mechanize' agent = mechanize.new page = agent.get("http://google.com/")
this simple script works ok.
but if i'am trying add require 'rubygems'
, require 'mechanize'
rails controller, server gives:
loaderror in newscontroller#find no such file load -- mechanize
i use rvm on ubuntu 10.04 server machnine. ruby version: 1.9.2, rails version: 3.0.3. server: passanger under apache2.
p.s. if run rails server
, go mysite.com:3000 works without error, there problem passanger!
please, me!
you shouldn't require gems in controller. thats why bundler added rails 3. add mechanize gemfile this
gem "mechanize"
and run
bundle install
on command line. gem mentioned here required on application startup.
Comments
Post a Comment