I am trying to run a Ruby app with the rest-client gem install. I keep getting the error message:
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient/windows/root_certs.rb:2:in `require': cannot load such file -- ffi (LoadError)
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient/windows/root_certs.rb:2:in `<top (required)>'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient/windows.rb:7:in `require_relative'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient/windows.rb:7:in `<top (required)>'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient.rb:16:in `require'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient.rb:16:in `<top (required)>'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/rest-client.rb:2:in `require'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/rest-client.rb:2:in `<top (required)>'
from app.rb:6:in `require'
from app.rb:6:in `<main>'
$ ./start ruby
Installing bundle
Starting server
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient/windows/root_certs.rb:2:in `require': cannot load such file -- ffi (LoadError)
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient/windows/root_certs.rb:2:in `<top (required)>'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient/windows.rb:7:in `require_relative'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient/windows.rb:7:in `<top (required)>'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient.rb:16:in `require'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/restclient.rb:16:in `<top (required)>'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/rest-client.rb:2:in `require'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/rest-client-1.8.0/lib/rest-client.rb:2:in `<top (required)>'
from app.rb:6:in `require'
from app.rb:6:in `<main>'
However I am sure that the gem is install:
rest-client (2.0.0.rc2, 1.8.0)
rest-open-uri (1.0.0)
rest_client (1.8.3)
Does anyone know possibly what I am doing wrong in the installation process?
The issue was the that FFI was not install and was the reason I was getting error messages. unfortunately using
bundle install
did not install it correct and I had to install the gem manually (which takes much longer than expected to install
gem install ffi
Related
I'm trying to run the command
thin -R lat.ru start
in the directory 50web\servers\dev (lat.ru is part of the open source project 50web).
I get the following error:
D:\dev\derek\50web\servers\dev>thin -R lat.ru start
C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': ca
nnot load such file -- 2.1/pg_ext (LoadError)
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/pg-0.18.4/lib/pg.rb:14:in `rescu
e in <top (required)>'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/pg-0.18.4/lib/pg.rb:3:in `<top (
required)>'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in
`require'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in
`rescue in require'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in
`require'
from C:/Ruby21/lib/ruby/site_ruby/2.1.0/getdb.rb:11:in `<top (required)>
'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from D:/dev/derek/50web/routes/lat.rb:2:in `<top (required)>'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in
`require'
from lat.ru:3:in `block in <main>'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:5
5:in `instance_eval'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/rack-1.6.4/lib/rack/builder.rb:5
5:in `initialize'
from lat.ru:1:in `new'
from lat.ru:1:in `<main>'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/thin-1.6.4/lib/rack/adapter/load
er.rb:33:in `eval'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/thin-1.6.4/lib/rack/adapter/load
er.rb:33:in `load'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/thin-1.6.4/lib/thin/controllers/
controller.rb:182:in `load_rackup_config'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/thin-1.6.4/lib/thin/controllers/
controller.rb:72:in `start'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/thin-1.6.4/lib/thin/runner.rb:20
0:in `run_command'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/thin-1.6.4/lib/thin/runner.rb:15
6:in `run!'
from C:/Ruby21/lib/ruby/gems/2.1.0/gems/thin-1.6.4/bin/thin:6:in `<top (
required)>'
from C:/Ruby21/bin/thin:23:in `load'
from C:/Ruby21/bin/thin:23:in `<main>'
I'm using pg 0.18.4, which seems like the most recent version:
D:\dev\derek\50web\servers\dev>gem list pg
*** LOCAL GEMS ***
pg (0.18.4)
D:\dev\derek\50web\servers\dev>gem update pg
Updating installed gems
Nothing to update
Ruby version is 2.1.7p400 (2015-08-18 revision 51632) [i386-mingw32].
How can I fix this error?
Update 1 (02.02.2016 08:08 MSK):
I've to run the same project on a different machine:
C:\usr\dp\dev\derek\50web\servers\dev>ruby lat.ru
C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- 2.2/pg_ext (LoadError)
from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg.rb:14:in `rescue in <top (required)>'
from C:/Ruby22/lib/ruby/gems/2.2.0/gems/pg-0.18.4/lib/pg.rb:3:in `<top (required)>'
from C:/Ruby22/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:128:in `require'
I noticed that Ruby seems to look for the pg_ext file in 2.2/pg_ext directory, whereas in reality it's installed in the C:\Ruby22\lib\ruby\gems\2.2.0\gems\pg-0.18.4\lib directory.
It looks like installation of C-extension part of pg gem is broken.
make sure postgresql development libraries are installed
reinstall pg gem and see if there are no error messages
Reinstallation with -f force flag, or better gem uninstall and gem install anew.
I fixed the error by uninstalling the pg gem and re-installing it using gem install pg --pre command. It's necessary because of a bug, which hasn't been fixed in the release version yet.
Trying to install gem rubyracer and gem execjs for reasons I can't remember.
Probably because I'm trying to deploy a jekyll site which is having major issues displaying on server.
So, tried running jekyll --server
Get this error:
/usr/local/rvm/gems/ruby-2.1.2/gems/execjs-2.2.1/lib/execjs/runtimes.rb:51:in `autodetect': Could not find a JavaScript runtime. See https://github.com/sstephenson/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)
from /usr/local/rvm/gems/ruby-2.1.2/gems/execjs-2.2.1/lib/execjs.rb:5:in `<module:ExecJS>'
from /usr/local/rvm/gems/ruby-2.1.2/gems/execjs-2.2.1/lib/execjs.rb:4:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-2.1.2/gems/coffee-script-2.2.0/lib/coffee_script.rb:1:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-2.1.2/gems/coffee-script-2.2.0/lib/coffee-script.rb:1:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-2.1.2/gems/jekyll-coffeescript-1.0.0/lib/jekyll-coffeescript.rb:2:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-2.1.2/gems/jekyll-2.1.0/lib/jekyll.rb:75:in `<top (required)>'
from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /usr/local/rvm/gems/ruby-2.1.2/gems/jekyll-2.1.0/bin/jekyll:6:in `<top (required)>'
from /usr/local/rvm/gems/ruby-2.1.2/bin/jekyll:23:in `load'
from /usr/local/rvm/gems/ruby-2.1.2/bin/jekyll:23:in `<main>'
from /usr/local/rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
from /usr/local/rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>'
So, hence the installation attempt of rubyracer and execjs
This is what I get when I try to install them (message is identical for both):
/usr/local/rvm/rubies/ruby-2.1.2/bin/gem:8:in `require': no such file to load -- rubygems (LoadError)
from /usr/local/rvm/rubies/ruby-2.1.2/bin/gem:8
Environment is linux server. Not my laptop.
additional information
which jekyll gets this: /usr/local/rvm/gems/ruby-2.1.2/bin/jekyll
echo $PATH gets this:
/usr/local/rvm/gems/ruby-2.1.2/bin:/usr/local/rvm/gems/ruby-2.1.2#global/bin:/usr/local/rvm/rubies/ruby-2.1.2/bin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/rvm/bin:/home/coffee/bin
ruby -v gets this: ruby 2.1.2p95 (2014-05-08 revision 45877) [i686-linux]
which ruby gets this: usr/local/rvm/rubies/ruby-2.1.2/bin/ruby
jekyll --server is deprecated, you can use jekyll serve.
I guess that it something wrong with your RVM. Try to remove it with rvm implode and install it again.
I have just updated to susy 2.1.2 from version 1.0.9 so I expected errors.
However, I have no idea what this means.
I do still have both versions installed:
Select gem to uninstall:
1. susy-1.0.9
2. susy-2.1.2
3. All versions
When running my compass:dev I get the following, although the task still finished. How can I remove the erorrs?
Running "compass:dev" (compass) task
C:/RUBY200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require': cannot load such file -- sass/script/node (LoadError)
from C:/RUBY200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
from C:/RUBY200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
from C:/RUBY200/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches/browser_support.rb:1:in `<top (required)>'
from C:/RUBY200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/RUBY200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/RUBY200/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:2:in `block in <top (required)>'
from C:/RUBY200/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `each'
from C:/RUBY200/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions/monkey_patches.rb:1:in `<top (required)>'
from C:/RUBY200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/RUBY200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/RUBY200/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass/sass_extensions.rb:9:in `<top (required)>'
from C:/RUBY200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/RUBY200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/RUBY200/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:5:in `block in <top (required)>'
from C:/RUBY200/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:4:in `each'
from C:/RUBY200/lib/ruby/gems/2.0.0/gems/compass-0.12.2/lib/compass.rb:4:in `<top (required)>'
from C:/RUBY200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/RUBY200/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/RUBY200/lib/ruby/gems/2.0.0/gems/compass-0.12.2/bin/compass:20:in `block in <top (required)>'
from C:/RUBY200/lib/ruby/gems/2.0.0/gems/compass-0.12.2/bin/compass:8:in `fallback_load_path'
from C:/RUBY200/lib/ruby/gems/2.0.0/gems/compass-0.12.2/bin/compass:19:in `<top (required)>'
from C:/Ruby200/bin/compass:23:in `load'
from C:/Ruby200/bin/compass:23:in `<main>'
Running "watch" task
Waiting...
Your Gemfile need only have these:
gem "susy", "~>2.1.0"
gem "sass", "~>3.3.0"
gem "breakpoint", "~>2.4.0"
Bundler will sort out the other dependencies (which are many), as well as updating the gems to the latest versions.
This is the message I got when trying to update Susy with bundler.
susy (~> 2.1.2) ruby depends on
sass (~> 3.3.0) ruby
compass (~> 0.12.6) ruby depends on
sass (3.2.19)
This means you will need at least Sass 3.3.0. The latest alpha pre release of Compass will work with this and you can install it with the following command:
gem install compass --pre
Alternatively if you are using a Gemfile you could install it like this:
gem "compass", "~> 1.0.0.alpha.19"
I tried the following command rhc setup and following message is displayed
/usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- net/ssh (LoadError)
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/rhc-1.8.9/lib/rhc/ssh_helpers.rb:18:in `<top (required)>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rhc-1.8.9/lib/rhc/wizard.rb:72:in `<class:Wizard>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rhc-1.8.9/lib/rhc/wizard.rb:6:in `<module:RHC>'
from /usr/local/lib/ruby/gems/1.9.1/gems/rhc-1.8.9/lib/rhc/wizard.rb:5:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/rhc-1.8.9/lib/rhc/commands/base.rb:4:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/rhc-1.8.9/lib/rhc/commands/app.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:45:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/rhc-1.8.9/lib/rhc/commands.rb:139:in `block in load'
from /usr/local/lib/ruby/gems/1.9.1/gems/rhc-1.8.9/lib/rhc/commands.rb:138:in `each'
from /usr/local/lib/ruby/gems/1.9.1/gems/rhc-1.8.9/lib/rhc/commands.rb:138:in `load'
from /usr/local/lib/ruby/gems/1.9.1/gems/rhc-1.8.9/lib/rhc/cli.rb:35:in `start'
from /usr/local/lib/ruby/gems/1.9.1/gems/rhc-1.8.9/bin/rhc:18:in `<top (required)>'
from /usr/local/bin/rhc:23:in `load'
from /usr/local/bin/rhc:23:in `<main>'
What is the problem?
periodically updating to the latest version of rhc is a good idea as well:
sudo gem update rhc
It should pull net-ssh in as a dependency.
Updating net-ssh to 2.9.3.beta1, as cremno suggested in this comment, resolved my problem and a few other people as well.
$ gem install net-ssh -v 2.9.3.beta1
this answer is from: rhc setup gives error `no such file dl/import`
This below code did the trick
sudo gem install net-ssh
I just installed win32-clibpoard for Ruby but it does not work because of a highly descriptive message RubyGem version error: win32-api(1.4.5 not >= 0).
Help needed.
C:> gem install win32-clipboard
Successfully installed win32-clipboard-0.5.2
1 gem installed
Installing ri documentation for win32-clipboard-0.5.2...
Installing RDoc documentation for win32-clipboard-0.5.2...
c:/ruby19/lib/ruby/site_ruby/1.9.1/rubygems.rb:926:in `report_activate_error': RubyGem version error: win32-api(1.4.5 not >= 0) (Gem::LoadError)
from c:/ruby19/lib/ruby/site_ruby/1.9.1/rubygems.rb:244:in `activate_dep'
from c:/ruby19/lib/ruby/site_ruby/1.9.1/rubygems.rb:236:in `activate'
from c:/ruby19/lib/ruby/site_ruby/1.9.1/rubygems.rb:213:in `rescue in try_activate'
from c:/ruby19/lib/ruby/site_ruby/1.9.1/rubygems.rb:210:in `try_activate'
from c:/ruby19/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:56:in `rescue in require'
from c:/ruby19/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from c:/ruby19/lib/ruby/gems/1.9.1/gems/windows-api-0.4.0/lib/windows/api.rb:1:in `<top (required)>'
from c:/ruby19/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:53:in `require'
from c:/ruby19/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:53:in `require'
from c:/ruby19/lib/ruby/gems/1.9.1/gems/windows-pr-1.2.1/lib/windows/clipboard.rb:1:in `<top (required)>'
from c:/ruby19/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:53:in `require'
from c:/ruby19/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:53:in `require'
from c:/ruby19/lib/ruby/gems/1.9.1/gems/win32-clipboard-0.5.2/lib/win32/clipboard.rb:1:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:33:in `require'
from <internal:lib/rubygems/custom_require>:33:in `rescue in require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from files2tracks.rb:1:in `<main>'
You should uninstall the actual gem win32-api, just execute gem uninstall win-32-api
and then proceed with:
1 Download the gem from http://rubyforge.org/frs/download.php/62628/win32-api-1.4.5-x86-mswin32-60.gem
2 And install it locally with:
gem install win32-api-1.4.5-x86-mswin32-60.gem
3 and then try:
gem install win32-clipboard