No Such File to Load - Mechanize

no such file to load -- mechanize

I did:

sudo gem install mechanize

and the following seems to be working:

Shoes.setup do
gem 'mechanize'
end

require 'mechanize'

It says 'Building native extensions' and is taking forever, but seems to be the norm according to hackety.org.

Rails rake mechanize - Error - No such file to load -- Mechanize

The task name is environment, not enviroment. There's a typo.
Change the line 2.

Ruby script cannot locate required gem

Gems must first be installed before you can require them in a script. To install a gem; first open a terminal window and then type:

gem install GEM-NAME or in your case: gem install mechanize

Error when trying to open a webpage with mechanize

You have to use a schema, otherwise mechanize thinks you are trying to open a local/relative path (as the error suggests).

br.open("google.com") should be br.open("http://google.com").

Then you will see an error mechanize._response.httperror_seek_wrapper: HTTP Error 403: b'request disallowed by robots.txt', because google.com does not allow crawlers. This can be remedied with br.set_handle_robots(False) before open.

Can't load 'mechanize' in rails 4.0.2

add this to Gemfile

gem 'mechanize'

then execute this command on the shell

bundle 


Related Topics



Leave a reply



Submit