tomkersten / chili_videos

ChiliProject/Redmine plugin which integrates with Transload.it to offer a private "YouTube-like" setup to your project site.
MIT License
11 stars 2 forks source link

Install Error #5

Closed tvaughan73 closed 12 years ago

tvaughan73 commented 13 years ago

mongrel log shows this after install and application start is attempted:

* Daemonized, any open files are closed. Look at log/mongrel.pid and log/mongrel.log for info. * Starting Mongrel listening at 0.0.0.0:12001 * Starting Rails with production environment... * Rails loaded. \ Loading any Rails specific GemPlugins /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:510:in read': can't convert Hash into Integer (TypeError) from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:510:inload' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:116:in load_gems_in' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:115:ineach' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:115:in load_gems_in' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:112:inreverse_each' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:112:in load_gems_in' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:309:inrefresh!' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:67:in from_gems_in' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:49:infrom_installed_gems' from /usr/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:109:in load' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:231:inload_plugins' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrelrails:117:in `cloaker' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:incall' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:inlistener' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrelrails:99:in`cloaker' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in call' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:ininitialize' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in new' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:inrun' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in run' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 from /usr/bin/mongrel_rails:19:inload' from /usr/bin/mongrel_rails:19

tomkersten commented 13 years ago

@tomdchi Thanks for the bug report. Can you tell me a bit about how you have it set up? The following information would be great:

Let me know when you get a chance & I'll check out whatever revision you are on & see if I can reproduce it.

tomkersten commented 13 years ago

@tomdchi any input on this? I am having a hard time reproducing some feedback, as I have it running in production and have had others report they did not run into any issues...

tvaughan73 commented 13 years ago

Sorry it has taken so long to get back to this. My server crashed and I have had to reinstall everything. Today I attempted to get your plugin to work again and I still have the same problem. I am using Redmine on a server running centos 5.6 with WHM/Cpanel. Everything was installed from the shell. Here is the output from the installation:

RAILS_ENV=production rake chili_videos:install (in /home/tcxtax/rails_apps/redmine) Migrating chili_videos-0.1.0... == CreateVideos: migrating =================================================== -- create_table(:videos) -> 0.0243s == CreateVideos: migrated (0.0245s) ==========================================

== CreateAssemblies: migrating =============================================== -- create_table(:assemblies) -> 0.0451s == CreateAssemblies: migrated (0.0452s) ======================================

== CreateDelayedJobs: migrating ============================================== -- create_table(:delayed_jobs, {:force=>true}) -> 0.0053s -- add_index(:delayed_jobs, [:priority, :run_at], {:name=>"delayed_jobs_priority"}) -> 0.0209s == CreateDelayedJobs: migrated (0.0263s) =====================================

== CreateSlugs: migrating ==================================================== -- create_table(:slugs) -> 0.0037s -- add_index(:slugs, :sluggable_id) -> 0.0054s -- add_index(:slugs, [:name, :sluggable_type, :sequence, :scope], {:unique=>true, :name=>"index_slugs_on_n_s_s_and_s"}) -> 0.0057s == CreateSlugs: migrated (0.0151s) ===========================================

== AddSlugCacheToVideos: migrating =========================================== -- add_column(:videos, :cached_slug, :string) -> 0.0058s -- add_index(:videos, :cached_slug, {:unique=>true}) -> 0.0112s == AddSlugCacheToVideos: migrated (0.0172s) ==================================

Symlinking assets (stylesheets, etc)...

The log file shows:

* Rails loaded. * Loading any Rails specific GemPlugins /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:510:in read': can't convert Hash into Integer (TypeError) from /usr/lib/ruby/site_ruby/1.8/rubygems/specification.rb:510:inload' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:116:in load_gems_in' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:115:ineach' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:115:in load_gems_in' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:112:inreverse_each' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:112:in load_gems_in' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:309:inrefresh!' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:67:in from_gems_in' from /usr/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:49:infrom_installed_gems' from /usr/lib/ruby/gems/1.8/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:109:in load' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:231:inload_plugins' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrelrails:117:in `cloaker' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:incall' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:149:inlistener' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrelrails:99:in`cloaker' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:in call' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/configurator.rb:50:ininitialize' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:in new' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:84:inrun' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/command.rb:212:in run' from /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281 from /usr/bin/mongrel_rails:19:inload' from /usr/bin/mongrel_rails:19

Hope this helps.

tomkersten commented 13 years ago

@tomdchi What version of ruby are you using?

tvaughan73 commented 13 years ago

RubyGems Environment:

tomkersten commented 13 years ago

Hmmm. I am running it on REE without issues...and doing the install from scratch. I'll goof around w/ it & see if I can reproduce the issue...not sure off-hand. Let me know if you have any ideas or peculiarities in your server config that may be of use...

tvaughan73 commented 13 years ago

Would there be any issues when the server is a shared hosting server running WHM/Cpanel? When I uninstall the plugin redmine works OK The issue comes in when I try to stop/start the application after running RAILS_ENV=production rake chili_videos:install. The application will not start.

I wonder if I need to try and install this at the user account level instead of at the server level. All gems installed at the server level are available to each user but a user can install gems just for their account. I will try that and see what happens.

tomkersten commented 13 years ago

Depending on the permissions of the gem directories, etc...and the user your application server (mongrel, unicorn, passenger...whatever) have, that may be the problem. I'm using bundler & have a gemset set up for the applications and haven't run into this.

Drop me a message and let me know if the user-level installation fixes it....

-tom

On Mon, Aug 8, 2011 at 3:29 PM, tomdchi < reply@reply.github.com>wrote:

Would there be any issues when the server is a shared hosting server running WHM/Cpanel? When I uninstall the plugin redmine works OK The issue comes in when I try to stop/start the application after running RAILS_ENV=production rake chili_videos:install. The application will not start.

I wonder if I need to try and install this at the user account level instead of at the server level. All gems installed at the server level are available to each user but a user can install gems just for their account. I will try that and see what happens.

Reply to this email directly or view it on GitHub: https://github.com/tomkersten/chili_videos/issues/5#issuecomment-1757848

tvaughan73 commented 13 years ago

Just tried at user account level with same result. What ruby gems version are you using?

tomkersten commented 13 years ago

Hmm....

We have it set up on REE (1.8.7). I have run it on Linux (Ubuntu) and OS X (for local development). I'll think about it a bit and see if I can come up with another idea of what could be causing it...let me know if you make any headway on it...

-tom

On Mon, Aug 8, 2011 at 3:43 PM, tomdchi < reply@reply.github.com>wrote:

Just tried at user account level with same result. What ruby gems version are you using?

Reply to this email directly or view it on GitHub: https://github.com/tomkersten/chili_videos/issues/5#issuecomment-1758007

tomkersten commented 13 years ago

@tomdchi I was just reviewing this a bit more closely & realized I answered you incorrectly...we are using gem -v 1.3.7...and I am wondering if that is it. I will try it out with 1.6.2 and see if I can replicate...

tomkersten commented 13 years ago

@tomdchi that is definitely it. I can reproduce it with rubygems v1.6.2 installed. It looks like this was a problem with that release & the way it was checking whether ruby 1.9+ was being used or not (http://rubyforge.org/tracker/?func=detail&atid=575&aid=28155&group_id=126). On line 510 of rubygems/specification.rb it calls something like:

code = if defined? Encoding 
              File.read file, :encoding => "UTF-8"
           else
              File.read file
           end

Encoding is defined by other libraries in 1.8.7, such as REXML ...so it passes that initial if-statement and then that ':encoding => "UTF-8"' is what is causing the error to be thrown. If you comment out the ", :encoding..." part of that line, I would bet it starts up for you. Obviously that is not the suggested fix...but...it would confirm the problem.

Now, on my system, this doesn't throw on "only" ChiliVideos' gemspec...it throws it on everything (active_support, etc)...so it doesn't look like a problem with the ChiliVideos gem (as of gem -v 1.6.2). If I upgrade rubygems to 1.8, the error changes to an error in the format of "undefined method `name' for GEM_NAME_HERE_AS_A_STRING"...which is the issue that reared its head with a lot of people a couple of months ago...where there was an incompatibility with Rails & Rubygems. The solution to that problem is to upgrade to rails 2.3.12+.

So, I believe the fix is this:

  1. Upgrade your version of rubygems to at least v1.8 (if not the current version of 1.8.8)
  2. Upgrade either ChiliProject (which has been upgraded to 2.3.latest as of CP-2.0) or manually upgrade Rails underneath it to 2.3.12+. I noticed it looks like you may be using Redmine...that will be the same resolution, as far as I can tell.

I am in the process of testing this out on my machine, but thought I would send it over now, as the direction looks/sounds promising and I may not finish my test until later today.

Here are a few links you can review if you are interested:

  1. Rubygems thread: http://rubyforge.org/tracker/index.php?func=detail&aid=29188&group_id=126&atid=575
  2. Redmine thread: http://www.redmine.org/issues/8325
  3. Rubygems discussion around the 1.6.2 issue: http://rubyforge.org/tracker/?func=detail&atid=575&aid=28155&group_id=126

Please let me know if this is a satisfactory answer to your problem...

tomkersten commented 13 years ago

@tomdchi FYI: doing the upgrade outlined above fixed the issue for me.

tvaughan73 commented 13 years ago

Still can't get this to work with Redmine. Redmine requires Rails 2.3.11 which will not work with Rubygems higher than 1.6.2.

tomkersten commented 13 years ago

Man, I'm not sure of the best option for you to take until Redmine upgrades...

but...one (hacky) way to "make" it work, would be to replace that :encoding flag in the specification.rb Rubygems file (ie: change File.read file, :encoding => "UTF-8" to File.read file#, :encoding => "UTF-8"). As I mentioned earlier, this is not awesome, but, I suspect it will work...and it should allow you to get up & running without any impact (since you don't use Ruby 1.9)...

Let me know what you think or if you try that out...

tomkersten commented 12 years ago

Did you give this a try? Or...did you think of another work around?

cbnoonan commented 12 years ago

I had this same issue and your workaround was perfect. Thanks, Tom!

tomkersten commented 12 years ago

@cbnoonan awesome! glad to hear it...

tomkersten commented 12 years ago

I'm going to close this ticket, as the suggested fix worked for me (locally)..and has been confirmed to work "in the wild"...

Feel free to re-open if you think there is a better solution I can provide on my end...