I'm trying to setup a Sinatra App with unicorn.
After following this example
and adjusting it to my needs, I've gotten this error:
<my_path_name>/vendor/bundle/ruby/1.9.1/gems/kgio-2.8.0/lib/kgio.rb:21:in 'require': cannot load such file -- kgio_ext (LoadError)
I'm using rvm 1.18.5, ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-linux] and the latest release of unicorn 4.5.0 which pulls kgio 2.8.0
The OS is Red Hat Enterprise Linux Server release 5.6.
I've also tried with ruby-1.9.3-p125.
Sounds like a similar problem here, maybe try one of those ideas.
Did the gem install go smoothly?
Related
I am trying to deploy a webapp in Ruby 3.0.2 and Rails 7.0.1 and I have a problem after deploying it via capistrano in a production server Ubuntu 20.04 with nginx(1.18.0) and passenger(6.0.12).
All the processes work fine but the app can not start in production. I get the passenger error page. Finding in logs I get the next error:
"Error: The application encountered the following error: You have already activated io-wait 0.1.0, but your Gemfile requires io-wait 0.2.1. Since io-wait is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports io-wait as a default gem"
I have tried to remove the gem io-wait but is a default system gem and I cannot remove it, I have upgraded the bundler to the latest (2.3.4) and the error persists. I have added the latest io-wait version (0.2.1) and got the same error.
Any help will be welcome.
I got it to work by adding
gem "io-wait", "0.1.0"
I then also had the problem with "strscan". Had to downgrade to "3.0.0".
I was able to get things going by using the following:
gem "io-wait", "0.2.0"
In my gem file I set the two offending gems to the old versions.
gem "io-wait", "0.1.0"
gem "strscan", "3.0.0"
After that, deploying and booting the app worked fine.
Ruby v3.0.2
Rails 7.0.0
by searching to access my Postgres DB on Openshift, i'm currently facing problem using net-ssh.
At this step - note that the installed Ruby version is 2.2.0 and net-ssh is 2.9.3-beta1
To be able to access the DB from my local DB IDE, i need to execute:
rhc port-forward myappname
But the execution returns this error: Checking available ports ... Could not parse PKey: no start line
As you can see in this post (an other ones e.g. this one), the fix is to back to a stable version of net-ssh. the 2.9.2.
What i've succesfully done.
But now, running rhc port-forward myappname is giving me the following error: .../2.2.0/rubygems/core_ext/kernel_require.rb:54:in 'require': cannot load such file
And the fix is to upgrade net-ssh to the 2.9.3-Beta1 version (see this post).
This is really weird! Seems that "the snake is biting its own tail" (don't know if that french expression got english translation).
Note that i've tried to make a clean setup with new ssh key gen (automatically and manually).
My system is runnin' Win 7 64bits.
I made uninstall/install of last version of Ruby.
Reinstall of rhc.
Last version running on rhc-1.36.4. The problem goes on.
Can you help?
Should i install an older version of ssh-net and/or Ruby (i'm not allowed to use ssh-net 2.5.2 due to new version of rhc)?
(sorry for my bad english)
rhc/Gemfile & rhc/rhc.gemspec required gem "net-ssh", "<= 2.9.2"
net-ssh version 2.9.2 use require dl/import atleast on pageant.rb
dl/import is removed from ruby see https://github.com/ruby/ruby/blob/v2_2_0/NEWS#L148-L149
instead fiddle is recommended
net-ssh 3.* seems to fix this(uses fiddle/{import,{ for ruby >= 2.1)
net-ssh version 3. seems to have drop in compatibility(still working on mine) for rhc
So a simple hack is to modify rhc/Gemfile & rhc/rhc.gemspec and install the gem
A guy already have done it.
A Solution(Untested)
gem 'rhc', :git => 'git://github.com/thrasher-redhat/rhc.git'
from https://stackoverflow.com/a/7421712/2382629
Alternative Solution(Tested even on windows 7 32bit :p)
git clone https://github.com/openshift/rhc
cd rhc
modify rhc/Gemfile & rhc/rhc.gemspec like https://github.com/openshift/rhc/pull/748/files then
gem build rhc.gemspec
it should output like
blah! blah! blah! warnings and msgs......
Successfully built RubyGem
Name: rhc
Version: 1.38.4
File: rhc-1.38.4.gem
then run
gem install rhc-1.38.4.gem
You need to use an older version of Ruby, try 1.9.3 or 2.0, or maybe even 2.1.
Hy guys,
I have a server with apache, passenger 4.0.50, ruby 2.1.2 (started with 1.9.3), RVM and dozen of ruby on rails 4.1.x apps.
RVM is used only to manage ruby versions.
Follows the bundler configuration for each app:
BUNDLE_FROZEN: '1'
BUNDLE_PATH: "/PATH/TO/DEPLOYED/APP/shared/bundle"
BUNDLE_WITHOUT: development:test
BUNDLE_DISABLE_SHARED_GEMS: '1'
In order to save disk space (a lot of space) I would like to remove old gems of each application using bundle clean
The idea is to keep 2 releases (capistrano) and to run the command before a new deploy in order to keep gems for the last release.
The problem is that gems installed whit ruby 1.9.3 are not removed.
Can you please confirm that:
Gems for ruby 2.1.2 are installed in /PATH/TO/DEPLOYED/APP/shared/bundle/ruby/2.1.0/gems
Gems for ruby 1.9.3 are installed in /PATH/TO/DEPLOYED/APP/shared/bundle/ruby/1.9.1/gems
I can remove directory /PATH/TO/DEPLOYED/APP/shared/bundle/ruby/1.9.1/gems since I'm not using ruby 1.9 anymore
Many thanks in advance for your help.
Mauro
You dont use ruby 1.9.x anymore, so just remove the gems directory for it.
I have a box with 3 Rails apps on it. I wan't to upgrade one of the apps so that it uses Ruby 2.0.0, while leaving the others running on 1.9.3-p394. I have both those Rubies installed via Rvm.
I'm trying to control the Ruby version that each app uses via it's Gemfile.
# Gemfile
ruby '2.0.0'
So, I changed the version number in the Gemfile locally, made sure it all worked, committed and now I'm trying to deploy the change to the server.
However, the cap deploy fails at this point
bundle install --gemfile [path to release Gemfile] --path [path to app bundle] --deployment --quiet --without development test
because
Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0
This is correct technically, my Gemfile does specify 2.0.0 and the app is currently running on 1.9.3. I'm trying to make it change versions before bundling though. How do I do that?
Your PATH is not set up correctly. You probably don't have bin: as the first entry in your path. That would lead to this error.
Even if you're not using Heroku it's worth reading this page on troubleshooting that issue: https://devcenter.heroku.com/articles/ruby-versions
Here is a link to an answer which will explain how to change your PATH on the server: Capistrano: Can I set an environment variable for the whole cap session?
If you have rvm maybe you can try to do
rvm use 2.0.0
before your bundler call.
If you're using rvm set the default to ruby 2.0.0 on your server
rvm --default use 2.0.0
Resolved the problem for me deploying to an AWS server from my mac - but I guess if I need to update my older sites I'll have to set the default back to 1.9.3 before deploying.
On my Mac Os running Snow Leopard 10.6.5 I successfully installed Ruby 1.9.2 performing these steps so that, in the Terminal, I have these results:
$ ruby -v
ruby 1.9.2p136 (2010-12-25 revision 30365) [x86_64-darwin10.5.0]
$ which ruby
/usr/local/bin/ruby
Now, when I run my RoR application and I get an error (in my case a "SocketError"), I have the following RoR "Framework Trace":
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:560:in `initialize'
...
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:772:in `get'
activeresource (3.0.1) lib/active_resource/connection.rb:112:in `send'
...
that means my RoR application is still running on the previous version of Ruby (v1.8.7)!!!
How can I run my RoR application using my new Ruby installation (v 1.9.2)?
P.S. I: all my RoR applications are located in /usr/< my_mac_account_name >/Sites directory
P.S. II: I am using Phusion Passenger
Not a solution for this particular problem, but you should really really use RVM to manage your Ruby installations. That's the easiest way to be sure you're using X version of Ruby (and thus it's related gems). Then you can switch between versions like this:
rvm use 1.9.2 #begin using Ruby 1.9.2
I suspect that your phusion passenger was built against the system Ruby, not the one you've got in /usr/local. Rebuild phusion Passenger but modify the path in the environment you're building phusion in.
On a linux:
export PATH=/usr/local/bin:$PATH
Not precisely sure of the PATH settings for Mac machines.
Reference:
http://www.modrails.com/documentation/Users%20guide%20Apache.html#_preparation_gem_and_source_tarball_only