I am new to programming (previously only did html/css/design) trying to start learning RoR via the book Simply Rails 2. However I want to start with the most recent versions of Ruby(1.9.2) and Rails (3) so I am forced to get everything configured without the book. I have looked a lot via google and on stackoverflow. When I run rails server it automatically uses Webrick, but I want to be using Mongrel. I installed the prerelease Mongrel via gem install mongrel --pre and removed the previous version. I read that in order to get Mongrel to work with rails server I had to add gem 'mongrel' to the Gemfile, but I do not know which one I should be adding it to (I tried several but nothing changed). So I decided to look at mongrel documentation via git and learned about mongrel_rails start when I run that I get this:
C:\Ruby192\shovell>mongrel_rails start
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment... C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/runtime.rb:27:in
'block in setup': You have already activated mongrel 1.2.
0.pre2, but your Gemfile requires mongrel 1.1.5. Consider using bundle exec. (Gem::LoadError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/spec_set.rb:12:in
'block in each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/spec_set.rb:12:in
'each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/spec_set.rb:12:in
'each'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/runtime.rb:17:in
'setup'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler.rb:100:in
'setup'
from C:/Ruby192/shovell/config/boot.rb:8:in '<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from C:/Ruby192/shovell/config/application.rb:1:in '<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from C:/Ruby192/shovell/config/environment.rb:2:in '<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from <internal:lib/rubygems/custom_require>:29:in 'require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/rails.rb:147:in
'rails'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:116:in
'block (2 levels) in run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:149:in
'call'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:149:in
'listener'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:102:in
'block in run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:50:in
'call'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:50:in
'initialize'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in
'new'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in
'run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/command.rb:210:in
'run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:282:in
'<top (required)>'
from C:/Ruby192/bin/mongrel_rails:19:in 'load'
from C:/Ruby192/bin/mongrel_rails:19:in '<main>'`
My best guess is that
C:/Ruby192/lib/ruby/gems/1.9.1/gems/bundler-1.0.0.rc.6/lib/bundler/runtime.rb:27:in
'block in setup': You have already activated mongrel 1.2.
0.pre2, but your Gemfile requires mongrel 1.1.5. Consider using bundle exec. is the key but I have not been able to solve it.
I would appreciate any help so that I can get on to actually learning
the language!
EDIT: I was able to get past the above issue thanks to #duddle but now I have another issue...I am getting this error:
C:\Ruby192\shovell>mongrel_rails start
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment... C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:239:in
'req uire': no such file to load -- dispatcher (LoadError)
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:239:in 'block in require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:225:in 'block in load_dependency'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:591:in 'new_constants_in'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:225:in 'load_dependency'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.0.rc2/lib/active_support/dependencies.rb:239:in 'require'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/rails.rb:148:in 'rails'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:116:in' block (2 levels) in run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:149:in 'call'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:149:in 'listener'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:102:in' block in run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:50:in 'call'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/configurator.rb:50:in 'initialize'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in 'new'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:86:in'run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/lib/mongrel/command.rb:210:in 'run'
from C:/Ruby192/lib/ruby/gems/1.9.1/gems/mongrel-1.2.0.pre2-x86-mingw32/bin/mongrel_rails:282:in '<top (required)>'
from C:/Ruby192/bin/mongrel_rails:19:in 'load'
from C:/Ruby192/bin/mongrel_rails:19:in '<main>
My best guess at this point (1am...very tired) is that I am missing a file or something is not named as it should be..maybe i need to use the :require action in my Gemfile..maybe I just need to sleep on it. Ha.
Again, thanks a ton #duddle for getting me past the first error! Any more help is greatly appreciated!
You have already activated mongrel 1.2. 0.pre2, but your Gemfile requires mongrel 1.1.5. Consider using bundle exec. is the key but I have not been able to solve it.
You were almost there!
gem 'mongrel', '>= 1.2.0.pre2'
The second parameter tells bundler to require a version equal to or greater than 1.2.0.pre2, which you have to use when using Ruby 1.9.2.
The Bundler page provides a nice reference on how to use the Gemfile: http://gembundler.com/gemfile.html
Just in case you didn't figure it out.
I ran gem install 'dispatcher' and added gem 'dispatcher' in the Gemfile of my app.
Then everything was fine.
From the small experience I have with ruby, everytime I have a "require -- no such file to load" problem. It is because I am missing a specific gem.
Hth...
add this line to your gem file:
gem 'mongrel', '>= 1.2.0.pre2'
at the command prompt:
run bundle install
start mongrel using this command:
rails server
Hey, I ran into that problem, the solution was quite simple:
Just add the gem 'dispatch'
;-)
The mongrel gem isn’t compatible with Ruby 1.9.2; you’ll have to use gem 'sho-mongrel' in its place.
Try to install it using:
gem install mongrel --pre
It worked for me perfect!!!
Related
I get the following error when trying to do anything with Ruby, specifically ruby gems:
/usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/2.4.0/yaml.rb:5:in `<top (required)>':
It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
/usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:130:in `require': incompatible library version - /usr/local/rvm/gems/ruby-2.4.5/gems/psych-3.1.0/lib/psych.so (LoadError)
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:34:in `require'
from /usr/local/rvm/gems/ruby-2.4.5/gems/psych-3.1.0/lib/psych.rb:16:in `rescue in <top (required)>'
from /usr/local/rvm/gems/ruby-2.4.5/gems/psych-3.1.0/lib/psych.rb:13:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/2.4.0/yaml.rb:6:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems.rb:729:in `load_yaml'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/config_file.rb:349:in `load_file'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/config_file.rb:202:in `initialize'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/gem_runner.rb:79:in `new'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/gem_runner.rb:79:in `do_configuration'
from /usr/local/rvm/rubies/ruby-2.4.5/lib/ruby/site_ruby/2.4.0/rubygems/gem_runner.rb:44:in `run'
from /usr/local/rvm/rubies/ruby-2.4.5/bin/gem:21:in `<main>'
I believe the line of note is this one:
LoadError: incompatible library version - /usr/local/rvm/gems/ruby-2.4.5/gems/psych-3.1.0/lib/psych.so
I get this from gem install puppet, gem update, etc. I tried uninstalling and reinstalling libyaml, and same with Ruby. The error happened after I did bundle uninstall puppet to get it to stop pointing to the 6.3.0 gem and point to the 4.10.2 executable. I need Ruby to be able to use Rspec to test the modules. Does anyone know how I can fix this?
Without steps to reproduce the broken system it is hard to say what happened, but I can say in general how you can set this up correctly to use a specific version of Puppet.
Does this help? In the worst case, you can probably uninstall RVM and reinstall it.
Before I continue, let me note that Puppet 4.10.2 and 4.10.3 have both been removed from Rubygems. (Although I was able to install it with PDK.)
For the remainder I assume 4.10.4 instead (just to distinguish it from latest 4.10).
The recommended approach is to use Puppet Development Kit (pdk). If you download and install PDK, you probably just need to do these steps:
pdk convert
rm Gemfile.lock
PUPPET_GEM_VERSION=4.10.4 bundle update # If that version isn't already in PDK.
pdk test unit --puppet-version 4.10.4
If you don't want to go down the PDK path, you can try these alternatives:
Hardcode the version of Puppet you want in Gemfile.
gem 'puppet', '4.10.4'
Or:
gem 'puppet', '~> 4.10' # latest 4.10
Then update your bundle:
rm -f Gemfile.lock
bundle update
Or, you can implement the PUPPET_GEM_VERSION feature by adding this code (this is what I do, for what it's worth):
if puppetversion = ENV['PUPPET_GEM_VERSION']
gem 'puppet', puppetversion
else
gem 'puppet'
end
And then:
rm -f Gemfile.lock
PUPPET_GEM_VERSION='~> 4.10' bundle update
Now you can run your unit tests against a specific version of Puppet per normal:
bundle exec rake spec
Or however you set it up.
While trying to use the following gems:
require 'nokogiri'
require 'restclient'
require 'mechanize'
I'm getting the following error:
C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- ffi_c (LoadError)
from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10-x86-mingw32/lib/ffi.rb:6:in `rescue in <top (required)>'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/ffi-1.9.10-x86-mingw32/lib/ffi.rb:3:in `<top (required)>'
from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0-x86-mingw32/lib/restclient/windows/root_certs.rb:2:in `<top (required)>'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0-x86-mingw32/lib/restclient/windows.rb:7:in `require_relative'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0-x86-mingw32/lib/restclient/windows.rb:7:in `<top (required)>'
from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/Ruby23/lib/ruby/gems/2.3.0/gems/rest-client-1.8.0-x86-mingw32/lib/restclient.rb:16:in `<top (required)>'
from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `require'
from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:133:in `rescue in require'
from C:/Ruby23/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:40:in `require'
from parse_docs.rb:5:in `<main>'
Since the last thing on this list is line 5, which is require 'restclient' I'm guessing it has something to do with that? However I've attempted to do the following:
Since restclient is deprecated and has moved to rest-client, I tried using rest-client however that doesn't work and produces the same error.
I've also attempted to require 'rubygems' but that when I run the program, it will not allow me to continue and produces the same error.
So I completely took out restclient, this is how I got the idea that restclient is causing the problem , because without it there, the program can run successfully.
So I though what would happen if I rolled back on ffi? So I installed the ffi version that is needed to run restclient However, that didn't help either.
Updated all my gems, still throwing the same error..
Downloaded the latest version on ffi, nothing changes, except now I havea new version of ffi on my system, that's still throwing an error when being used with restclient
Why is restclient producing the ffi error, I've never had this happen to me before. Is rest-client deprecated? Or is there a simple solution that I'm not catching onto? I've researched this, and nobody has had this problem (while using restclient) however there is a ton of people who have gotten this error while using other gems. For example see also here. It might also be worth mentioning that I'm running Windows 7.
The error comes after the ffi tries to load its C extension. If we have a look at the source code of the FFI gem, it tries to load the compiles extension according to the version of Ruby currently running:
begin
require RUBY_VERSION.split('.')[0, 2].join('.') + '/ffi_c'
rescue Exception
require 'ffi_c'
end
The first part fails so it falls back to the require 'ffi_c' which also fails. The problem now is that the first part should not fail.
In your case, it seems you are using a FFI gem which was compiled for another version of Ruby. Unfortunately, ruby has changes its ABI during releases so this doesn't work.
Thus, you need to make sure you are either using the pre-compiled gem matching your ruby version (which might be hard to find) or compiling it yourself. For that, please install the Development Kit for your Ruby version (towards the bottom left of the page). Then, you can install the ffi gem and force it to compile the C-extension on installation:
gem install ffi --platform=ruby
This is required as gem install ffi (without the --platform parameter), rubygems first tries to install the gem variant specific to your platform, i.e. mingw32 in your case, which is available in pre-compiled from from rubygems.org. Unfortunately, this precompiled gem apparently is incompatible with your version of Ruby. As such, you can force rubygems to get the source-version of the gem and compile the C-extension on its own. This is what you are instructing rubygems to do with the --platform=ruby argument.
This matches the description in the issues on FFI's issue tracker.
So I found an answer to this, it had to do with Holger Just's answer with a minor tweak, I'm pretty sure my case is pretty unique because my company likes to hide behind a VPN script. So here's how I did it:
First I needed to install the pre-release gem of ffi using the platform flag: gem install ffi --pre --platform=ruby
Next I had to update the gem: gem update --all (I think that's the correct syntax for the flag)
That got ffi working.
I am writing a Ruby script, and I would like to use wordNet to stem String. I want to give it a string that may contain words of the same form and get back the string but after stemming it. I came across Ruby-WordNet and installed wordnet gem and wordnet-defaultdb gem. I also installed Sequel since it is required.
However, I am not sure how to deal with it. When I typed in the script:
require 'rubygems'
require 'sequel'
require 'wordnet'
I get the following error:
/Users/arwa/.rvm/rubies/ruby- 2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:2112:in `raise_if_conflicts': Unable to activate wordnet-1.0.0, because sequel-4.24.0 conflicts with sequel (~> 3.38) (Gem::ConflictError)
from /Users/arwa/.rvm/rubies/ruby- 2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/specification.rb:1280:in `activate'
from /Users/arwa/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems.rb:198:in `rescue in try_activate'
from /Users/arwa/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems.rb:195:in `try_activate'
from /Users/arwa/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:126:in `rescue in require'
from /Users/arwa/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from ./test.rb:5:in `<main>'
If I removed
require 'sequel'
I get the following error:
/Users/arwa/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require': cannot load such file -- sequel (LoadError)
from /Users/arwa/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from /Users/arwa/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from /Users/arwa/.rvm/gems/ruby-2.2.1/gems/wordnet-1.0.0/lib/wordnet.rb:5:in `<top (required)>'
from /Users/arwa/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
from /Users/arwa/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `rescue in require'
from /Users/arwa/.rvm/rubies/ruby-2.2.1/lib/ruby/site_ruby/2.2.0/rubygems/core_ext/kernel_require.rb:39:in `require'
from ./test.rb:4:in `<main>'
I am not sure what is the problem and how to deal with it.
Does any one have any idea on how it works?
Also, if someone can direct me to a place where I can find example on how to code it and to deal with it.
Many thanks in advance.
The error says you have a version conflict.
See what gem list sequel --all says. Odds are good you loaded only the latest version of Sequel by using gem install sequel without specifying the version, or that you have two versions, the one specified by WordNet and the latest
Try removing/uninstalling all Sequel versions installed and reinstall only the specific version:
gem install sequel -v3.38
You can also try modifying the gem requirements for WordNet to not require a specific version of Sequel. Sequel is extremely stable so that should be a safe move.
You have conflicting gem versions installed:
require 'rubygems'
gem 'sequel', '3.48'
require 'sequel'
require 'wordnet'
Will solve your issue.
You can help yourself with a Gemfile. Run bundle init to create one. Run gem install bundler if you have no bundler.
Gemfile:
source "https://rubygems.org"
gem 'sequel'
gem 'wordnet'
Run bundle after you saved your Gemfile. Check Gemfile.lock for the solution.
While loading a Thin webserver for a sinatra app I keep getting
Unable to load the EventMachine C extension; To use the pure-ruby reactor, require em/pure_ruby'<path>/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.rc.4/lib/eventmachine.rb:8:in `require': cannot load such file -- rubyeventmachine (LoadError)
from <path>/vendor/bundle/ruby/1.9.1/gems/eventmachine-1.0.0.rc.4/lib/eventmachine.rb:8:in `<top (required)>'
from <path>/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin.rb:7:in `require'
from <path>/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/lib/thin.rb:7:in `<top (required)>'
from <path>/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/bin/thin:5:in `require'
from <path>/vendor/bundle/ruby/1.9.1/gems/thin-1.5.0/bin/thin:5:in `<top (required)>'
from <path>/vendor/bundle/ruby/1.9.1/bin/thin:19:in `load'
from <path>/vendor/bundle/ruby/1.9.1/bin/thin:19:in `<main>'
In my Mac OSX I boot the server without any problems but in my server which is a
Red Hat Enterprise Linux Server release 6.2 (Santiago)
I can't start my app.
I'm using rvm 1.18.5 and ruby-1.9.3-p374
Regards and thanks in advance.
Anyone came across this issue?
I've worked around the problem dumping most of my Bundler configured gems and installing them directly on my global gemset. I had to remove all Bundler references from my Sinatra load up code and use only rubygems instead.
Right now I only need Bundler for testing with cucumber and deployment with capistrano.
try reinstall the gem 'eventmachine':
$ gem uninstall eventmachine
$ gem install eventmachine
or
$ bundle install
see: https://stackoverflow.com/a/15140634/445908
I fixed my "Unable to load the EventMachine C extension" error by uninstalling homebrew's version of ruby 2.5. See this comment on Rails/Ruby Error When Creating Database: Unable to load the EventMachine C extension
I'm working on some cucumber tests from The Cucumber Book. I've got the code that tries to use a transaction processor and there is a file with the following code:
require 'service_manager'
ServiceManager.start
This is on Mac OS X 10.6.8 using Ruby 1.9.2. When this file executes, I get the following:
no such file to load -- service_manager (LoadError)
/opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
/opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
/opt/local/lib/ruby1.9/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
/Users/gpollice/MyCucumber/ATMBookExample/features/support/services.rb:6:in `<top (required)>'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.2/lib/cucumber/rb_support/rb_language.rb:143:in `load'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.2/lib/cucumber/rb_support/rb_language.rb:143:in `load_code_file'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.2/lib/cucumber/runtime/support_code.rb:171:in `load_file'
/opt/local/lib/ruby1.9/gems/1.9.1/gems/cucumber-1.1.2/lib/cucumber/runtime/support_code.rb:83:in `block in load_files!'
The service_manager gem is installed in /opt/local/lib/ruby1.9/gems/1.9.1/gems as are other gems that the application uses. Until I added the code for this iteration, there were no problems. I've looked for reasons why the gem is not found and just can't figure out why. Any help would be appreciated.
It appears to be a load path issue.
Is require "rubygems" invoked prior to this require statement?
Also, if you're using bundler, you have to add this gem to your Gemfile, as bundler attempts to sandbox your dependencies. If you're using bundler, try the following after adding the gem to the Gemfile:
bundle exec rake cucumber