rubygems / bundler

Manage your Ruby application's gem dependencies
https://bundler.io
MIT License
4.88k stars 2k forks source link

Bundler.require breaks twilio-ruby gem, I want to help fix it. #3072

Closed alex-meis closed 9 years ago

alex-meis commented 10 years ago

Hello, I don't know if this is the right place to put this but I'd like to help you debug the problem if that's ok.

Using Bundler.require(:default, Rails.env) with the twilio-ruby gems destroys the functionality of the gem, all the class methods don't exist.

I've got a bit of a rant going on over here: http://stackoverflow.com/questions/24297635/twilio-library-doesnt-work-in-rails-but-works-outside-rails

I've narrowed it down to the function call and I can't imagine what it's doing, but because I'm a newbie to Ruby/Rails I'm not sure where to go from here. Removing Bundler.require and requiring everything by hand resolves the problem for me. I'd rather avoid fundamentally changing the code base I have inherited.

How can I get you more information?

TimMoore commented 10 years ago

Can you send us the full contents of your Gemfile? My guess is that it's most likely a conflict between two different gems, and it may depend on the order they're required.

It would be even more awesome if you can cut the Gemfile down to the minimum set of gems that reproduces the problem, or see if you can reproduce it in a project with just the twilio-ruby gem.

indirect commented 10 years ago

In the meantime, you can stop Bundler.require from loading twilio-ruby by adding “, :require => false” to the end of its line in your Gemfile.

On Jun 18, 2014, at 10:04 PM, Tim Moore notifications@github.com wrote:

Can you send us the full contents of your Gemfile? My guess is that it's most likely a conflict between two different gems, and it may depend on the order they're required.

It would be even more awesome if you can cut the Gemfile down to the minimum set of gems that reproduces the problem, or see if you can reproduce it in a project with just the twilio-ruby gem.

— Reply to this email directly or view it on GitHub.

alex-meis commented 10 years ago

I've tried reording my Gemfile to no result. Here is the exact file. I also removed everything except what allows the system to boot up

#Required to Boot modules 
require "rack/cors"
require "authority"
require "carrierwave"
require "devise"
require "rails-observers"
require "formtastic"
require "bitmask_attributes"
require "twilio-ruby"
require "prawn"
require "will_paginate"
require "paranoia"
require "validates_timeliness"
# Gemfile
source 'https://rubygems.org'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.1.0'
#gem 'bundler', '1.5'

gem 'smarter_csv', '1.0.10'
gem 'carrierwave', '0.9.0'
gem 'formtastic', '2.2.1'
gem 'pg', '0.15.1'
gem 'authority', '2.9.0'
gem 'twilio-ruby', '~> 3.11'
gem 'devise', '3.2.2'
gem 'factory_girl_rails', '4.2.1'
gem 'faker', '1.1.2'
gem 'paranoia', '2.0.0'
gem 'phone', '1.1.0'
gem 'rails-observers'
gem 'liquid', '2.5.0'
gem 'validates_timeliness', '3.0.14'
gem 'prawn', '1.0.0.rc2'
# gem 'googlecharts', '1.6.8'
# gem 'ftpd', '0.9.0'
gem 'will_paginate', '~> 3.0.5'
gem 'activerecord-session_store'
gem 'fog'
gem 'bitmask_attributes'
gem 'delayed_job_active_record'
#gem 'amqp'
gem 'rack-cors', :require => 'rack/cors'
gem 'oauth'
gem 'rabl'
gem 'mandrill-api'

gem 'user_impersonate2', :require => 'user_impersonate'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '2.1.1'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer'

# Use jquery as the JavaScript library
gem 'jquery-rails'
gem 'jquery-rails-google-cdn'
gem 'jquery-ui-rails'
gem 'jquery-ui-rails-google-cdn'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '1.4.2'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end

group :production do
  gem 'newrelic_rpm'
end

group :development, :test do
  gem 'pry-rails', '0.3.1'
  gem 'rspec-rails', '2.13.2'
  gem 'rspec', '2.13.0'
  gem 'rspec-core', '2.13.1'
  gem 'sms-spec', '0.1.7'
  gem 'thin'
end

# Use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the app server
# gem 'unicorn'

# Use Capistrano for deployment
group :development do
  gem 'capistrano', '~> 3.1.0'
  #gem 'rvm-capistrano', '1.3.0'
  #gem 'capistrano-ext', '1.2.1'
end

group :assets do
  gem 'sass-rails'
  gem 'compass-rails'
  gem 'asset_sync'
end

# Use debugger
# gem 'debugger', group: [:development, :test]
mikegee commented 10 years ago

@kinvolved1 Do you see the same behavior when the Gemfile contains only "twilio-ruby"? If not, could you try to reduce the Gemfile to the smallest combination that show the problem? (Remove half the gems, test, then either put them back & remove the other half, or remove half of the remaining gems ... )

TimMoore commented 10 years ago

@kinvolved1 were you able to try out @mikegee's suggestion?

agis commented 9 years ago

Closing this due to lack of feedback.

@kinvolved1 Feel free to share more info (eg. reproduction steps) and I'll happily reopen :)