我正在尝试在Heroku上部署应用程序,但是应用程序崩溃了,当我运行heroku logs
时我得到了这个(下面的完整跟踪;下面是Gemfile内容)。
You have already activated rack 1.2.1, but your Gemfile requires rack 1.0.1
我正在使用bundler(1.0.0.rc.6)进行gem管理。
我也有Scrapi问题,即使Heroku在Linux环境中运行,也需要Mac lib:
Scraper::Reader::HTMLParseError: Unable to load /disk1/home/slugs/254653_91616fb_8a40/mnt/.bundle/gems/ruby/1.8/gems/scrapi-1.2.0/lib/scraper/../tidy/libtidy.dylib
跟踪:
/usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:27:in `setup': You have already activated rack 1.2.1, but your Gemfile requires rack 1.0.1. Consider using bundle exec. (Gem::LoadError)
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/spec_set.rb:12:in `each'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler/runtime.rb:17:in `setup'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.0/lib/bundler.rb:100:in `setup'
from /disk1/home/slugs/254653_1bad33f_8a40/mnt/config/../config/preinitializer.rb:16
from /disk1/home/slugs/254653_1bad33f_8a40/mnt/config/boot.rb:43:in `load'
from /disk1/home/slugs/254653_1bad33f_8a40/mnt/config/boot.rb:43:in `preinitialize'
from /disk1/home/slugs/254653_1bad33f_8a40/mnt/config/boot.rb:25:in `boot!'
from /disk1/home/slugs/254653_1bad33f_8a40/mnt/config/boot.rb:125
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /disk1/home/slugs/254653_1bad33f_8a40/mnt/config/environment.rb:7
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/rack/adapter/rails.rb:42:in `load_application'
from /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/thin-1.2.6/lib/rack/adapter/rails.rb:23:in `initialize'
from /home/heroku_rack/heroku.ru:31:in `new'
from /home/heroku_rack/heroku.ru:31
from /home/slugs/254653_1bad33f_8a40/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /home/slugs/254653_1bad33f_8a40/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /home/slugs/254653_1bad33f_8a40/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:63:in `new'
from /home/slugs/254653_1bad33f_8a40/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:63:in `map'
from /home/heroku_rack/heroku.ru:20
from /home/slugs/254653_1bad33f_8a40/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /home/slugs/254653_1bad33f_8a40/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /home/heroku_rack/heroku.ru:13:in `new'
from /home/heroku_rack/heroku.ru:13
from /home/slugs/254653_1bad33f_8a40/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `instance_eval'
from /home/slugs/254653_1bad33f_8a40/mnt/.bundle/gems/ruby/1.8/gems/rack-1.2.1/lib/rack/builder.rb:46:in `initialize'
from /home/heroku_rack/heroku.ru:1:in `new'
from /home/heroku_rack/heroku.ru:1
-----> Your application is requiring a file that it can't find.
Most often this is due to missing gems, or it could be that you failed
to commit the file to your repo. See http://docs.heroku.com/gems for
more information on managing gems.
source :gemcutter
gem "rails", "~> 2.3.5"
gem "pg", :group => :production
gem "calendar_date_select"
gem "paperclip"
gem "nokogiri"
gem "webrat"
gem "scrapi", "~>1.2.0"
gem "tidy", "~>1.1.2"
gem "facebooker"
gem "shoulda"
gem "devise", "~>1.0.7"
gem "devise_facebook_connectable", "~>0.2.1"
gem "mysql"
gem "rack", "~>1.0.1"
答案 0 :(得分:0)
我已切换到.gems。 整洁的问题是我必须在运行任务之前或在环境中将Tidy.path =设置为.so lib路径。
答案 1 :(得分:0)
从未设法理清这个问题......设置一个不同的解析器让我继续生活 scraper.scrape(uri,:parser =>:html_parser)