Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not find eventmachine-1.2.5 in any of the sources #177

Open
ltfschoen opened this issue Oct 10, 2017 · 1 comment
Open

Could not find eventmachine-1.2.5 in any of the sources #177

ltfschoen opened this issue Oct 10, 2017 · 1 comment

Comments

@ltfschoen
Copy link

ltfschoen commented Oct 10, 2017

I get the following error when trying to run a Rails Server with rails s using a Rails 5.1.3 app with Ruby 2.4.2 and RubyGems 2.6.13 and macOS Sierra 10.12.6

$ rails s
Could not find eventmachine-1.2.5 in any of the sources
Run `bundle install` to install missing gems.

I have the following in my Gemfile

group :development, :test do
  gem 'eventmachine', '1.2.5'
  gem 'guard', '~> 2.14.1'
  gem 'guard-rspec', '~> 4.7.3'
  gem 'guard-livereload', '~> 2.5.2'
end

I have tried gem install eventmachine -v '1.2.5, running gem list shows eventmachine (1.2.5), and confirmed the gempath with gem env

I have tried using previous versions of Ruby 2.4.1, previous versions of eventmachine gem, and numerous other alternatives.

@ltfschoen
Copy link
Author

ltfschoen commented Oct 10, 2017

Below is a solution that I hacked together that fixed the problem in my Rails project called Guard Demo repo here https://github.com/ltfschoen/guard_demo where I am using Rails 5.1.3 app with Ruby 2.4.2 and RubyGems 2.6.13 and macOS Sierra 10.12.6 and PostgreSQL and wanted to use both Guard RSpec Gem and Guard LiveReload Gem

  • Using RBEnv I switched to latest Ruby Version
    rbenv global 2.4.2; rbenv shell 2.4.2

  • Then I added Guard LiveReload to Gemfile
    group :development, :test do gem 'guard-livereload', '~> 2.5', require: false end

  • Then I installed dependencies
    bundle install

    • Generate LiveReload config files
      bundle exec guard init livereload
      
  • But when I tried to run the Rails server with rails s it gave error:

    Could not find eventmachine-1.2.5 in any of the sources
    Run `bundle install` to install missing gems.
    
  • Initially, I tried numerous solutions proposed around the internet for about 3 hours, but none worked, but then I progressed as follows:

  • Solution: Change Gemfile to the following, so eventmachine gem pointed to the project's vendor/bundle/gems directory. I also added gem rb-fsevent as recommended by http://railscasts.com/episodes/264-guard

    group :development, :test do
      gem 'eventmachine', '1.2.5',
        path: 'vendor/bundle/gems/eventmachine-1.2.5',
        require: 'eventmachine'
      gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i
      gem 'guard-rspec', '~> 4.7.3'
      gem 'guard-livereload', '~> 2.5.2'
    end
    
  • Then I updated gems in Gemfile.lock

    bundle update
    
  • But then I got a different error, which turned out to be associated with the PostgreSQL gem

  • Error still when running rails s

     ~/guard_demo/vendor/bundle/gems/pg-0.21.0/lib/pg.rb:4:in `require': 
     dlopen(~/guard_demo/vendor/bundle/gems/pg-0.21.0/lib/pg_ext.bundle, 9): Symbol not found: 
     _rb_cFixnum (LoadError)
    
  • Solution that worked was to switch from PostgreSQL version 0.21.0 to 0.20.0 by changing Gemfile to the following, including pointing to the project's vendor/bundle/gems directory

    gem 'pg', '0.20',
      path: 'vendor/bundle/gems/pg-0.20.0',
      require: 'pg'
    
  • Then again I updated Gemfile.lock

    bundle update
    
  • But then I got more errors associated with the http_parser.rb Gem

    $ bundle exec guard
    
    21:55:09 - ERROR - Invalid Guardfile, original error is: 
    > [#] 
    > [#] incompatible library version - ~/guard_demo/vendor/bundle/gems/http_parser.rb-0.6.0/lib/ruby_http_parser.bundle, 
    
$ rails s
Could not find http_parser.rb-0.5.3 in any of the sources
Run `bundle install` to install missing gems.
  • I solved this by loading http_parser.rb's earlier version 0.5.3 in the Gemfile instead of 0.6.0

    group :development, :test do
      gem 'http_parser.rb', '0.5.3'
    end
    
    • Then I update Gemfile.lock again
    bundle update
    
  • Then it all worked. I opened two Terminal Tabs and ran the following

    • In Tab 1 - rails s
    • In Tab 2 - bundle exec guard

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant