knife upload fails on dependency checks but dependencies are there - upload

I am trying to upload the wordpress cookbook from the Chef Store to my server, but it keeps failing on two dependencies, saying they are not on the server, but they are already there.
> knife cookbook upload wordpress
Uploading wordpress [3.0.0]
ERROR: Cookbook wordpress depends on cookbooks which are not currently
ERROR: being uploaded and cannot be found on the server.
ERROR: The missing cookbook(s) are: 'mysql2_chef_gem' version '~> 1.0.1', 'php-fpm' version '~> 0.6.10'
---------
knife cookbook list
7-zip 1.0.2
ant 1.0.2
apache2 3.2.2
app-slave 0.3.0
apt 2.9.2
ark 0.9.0
artifact 1.12.1
bash-shellshock 1.0.0
bluepill 2.3.1
build-essential 2.2.3
certificate 1.0.0
certificate-concatenation 0.1.1
chef-client 4.3.0
chef-secret 0.1.0
chef-sugar 3.3.0
chef-vault 1.3.2
chef_handler 1.2.0
chocolatey 0.4.0
compat_resource 12.7.1
cron 1.6.1
curl 2.0.1
database 5.1.2
debitel-service 0.9.0
dmg 2.3.0
docker 2.4.12
docker-registry-credentials 0.1.0
git 4.3.4
iis 4.2.0
java 1.39.0
java-service 0.7.0
logrotate 1.9.2
logstash 0.12.0
logstash-agent 0.9.0
mariadb 0.3.1
mesos 3.5.1
mesosphere_dcos 0.2.1
mysql 8.0.2
mysql2_chef_gem 1.1.0
nexus 3.3.0
nginx 2.7.6
nginx-proxy 0.2.1
nginx_php-fpm 0.1.0
nginxproxy 0.1.0
nginxproxy443 0.2.0
nginxproxy443_stage 0.2.0
nginxproxy8080 0.1.0
nginxproxy8888 0.1.0
nginxproxy8888_ssl 0.1.1
nginxproxy8888_ssl_production 0.1.1
nginxproxy8888_ssl_stage 0.1.1
ohai 2.0.1
openssl 4.4.0
packagecloud 0.0.19
php 1.10.1
php-fpm 0.7.6
poise 2.3.2
poise-languages 1.0.0
poise-python 1.0.0
postgresql 4.0.6
python 1.4.6
rsyslog 2.0.0
runit 1.7.2
selinux 0.9.0
server_setup 0.1.3
ssh-keys 1.2.7
sudo 2.7.2
sudo_centos 0.1.0
supervisord 1.0.1
tar 0.7.0
users 1.8.2
users_itops 0.1.0
users_oetinger 0.1.0
users_tigerbooks 0.1.0
windows 1.44.3
xml 2.0.0
yum 3.10.0
yum-epel 0.6.2
zabbix-agent 0.13.0
zookeeper 3.0.0
When I turn full verbosity on the upload command I get this:
> knife cookbook upload wordpress -VV
INFO: Using configuration from /Users/jjimenez/.chef/knife.rb
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_request
DEBUG: Signing the request as juan
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_request
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_request
DEBUG: Initiating GET to https://itdevchef.verlagsgruppe-oetinger.de/organizations/tigerbooks/cookbooks?num_versions=all
DEBUG: ---- HTTP Request Header Data: ----
DEBUG: Accept: application/json
DEBUG: Accept-Encoding: gzip;q=1.0,deflate;q=0.6,identity;q=0.3
DEBUG: X-Ops-Server-API-Version: 1
DEBUG: ---- End HTTP Request Header Data ----
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: openresty/1.9.7.2
DEBUG: date: Mon, 05 Sep 2016 11:11:29 GMT
DEBUG: content-type: application/json
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
DEBUG: x-ops-server-api-version: {"min_version":"0","max_version":"1","request_version":"1","response_version":"1"}
DEBUG: x-ops-api-info: flavor=cs;version=12.0.0;oc_erchef=12.8.0
DEBUG: content-encoding: gzip
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: Chef::HTTP calling Chef::HTTP::ValidateContentLength#handle_response
DEBUG: HTTP server did not include a Content-Length header in response, cannot identify truncated downloads.
DEBUG: Chef::HTTP calling Chef::HTTP::RemoteRequestID#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Authenticator#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::Decompressor#handle_response
DEBUG: Decompressing gzip response
DEBUG: Chef::HTTP calling Chef::HTTP::CookieManager#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONOutput#handle_response
DEBUG: Chef::HTTP calling Chef::HTTP::JSONInput#handle_response
Uploading wordpress [3.0.0]
DEBUG: Versions of cookbook 'php' returned by the server: 1.10.1
DEBUG: Matched cookbook 'php' with constraint '>= 0.0.0' to cookbook version '1.10.1' on the server
DEBUG: Versions of cookbook 'openssl' returned by the server: 4.4.0
DEBUG: Matched cookbook 'openssl' with constraint '>= 0.0.0' to cookbook version '4.4.0' on the server
DEBUG: Versions of cookbook 'apache2' returned by the server: 3.2.2
DEBUG: Matched cookbook 'apache2' with constraint '>= 2.0.0' to cookbook version '3.2.2' on the server
DEBUG: Versions of cookbook 'database' returned by the server: 5.1.2
DEBUG: Matched cookbook 'database' with constraint '>= 1.6.0' to cookbook version '5.1.2' on the server
DEBUG: Versions of cookbook 'mysql' returned by the server: 8.0.2
DEBUG: Matched cookbook 'mysql' with constraint '>= 6.0' to cookbook version '8.0.2' on the server
DEBUG: Versions of cookbook 'mysql2_chef_gem' returned by the server: 1.1.0
DEBUG: Versions of cookbook 'build-essential' returned by the server: 2.2.3
DEBUG: Matched cookbook 'build-essential' with constraint '>= 0.0.0' to cookbook version '2.2.3' on the server
DEBUG: Versions of cookbook 'iis' returned by the server: 4.2.0
DEBUG: Matched cookbook 'iis' with constraint '>= 1.6.2' to cookbook version '4.2.0' on the server
DEBUG: Versions of cookbook 'tar' returned by the server: 0.7.0
DEBUG: Matched cookbook 'tar' with constraint '>= 0.3.1' to cookbook version '0.7.0' on the server
DEBUG: Versions of cookbook 'nginx' returned by the server: 2.7.6
DEBUG: Matched cookbook 'nginx' with constraint '~> 2.7.4' to cookbook version '2.7.6' on the server
DEBUG: Versions of cookbook 'php-fpm' returned by the server: 0.7.6
DEBUG: Versions of cookbook 'selinux' returned by the server: 0.9.0
DEBUG: Matched cookbook 'selinux' with constraint '~> 0.7' to cookbook version '0.9.0' on the server
ERROR: Cookbook wordpress depends on cookbooks which are not currently
ERROR: being uploaded and cannot be found on the server.
ERROR: The missing cookbook(s) are: 'mysql2_chef_gem' version '~> 1.0.1', 'php-fpm' version '~> 0.6.10'
The cookbooks -are- there, but they don't generate a match. ????
Anybody know what's going on and/or how to fix this?

ERROR: The missing cookbook(s) are: 'mysql2_chef_gem' version '~> 1.0.1', 'php-fpm' version '~> 0.6.10'
mysql2_chef_gem 1.1.0
php-fpm 0.7.6
Here your constraints are pessimistic greater than match, with version X.Y.Z, it means Z should be greater or equal, but X and Y should be the same.
It sounds like you don't have a mysql2_chef_gem cookbook in version 1.0.x nor a php-fpm in version 0.6.x uploaded to your chef-server.
you can check with knife cookbook show <cookbook_name> or knife cookbook list -a to see all versions.

Related

Can't use Nokogiri gem on M1 processor

I have a problem with using the M1 processor and Nokogiri gem.
Gemfile
...
gem 'nokogiri', '>= 1.13.5'
...
When I run bundle install, all seems good, but when I try to run specs, for example, I see the error:
LoadError:
dlopen(/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6/lib/nokogiri/nokogiri.bundle, 0x0009): tried: '/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6/lib/nokogiri/nokogiri.bundle' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')) - /Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6/lib/nokogiri/nokogiri.bundle
I've tried to install Nokogiri with gem install nokogiri -v 1.13.6 --platform arm64-darwin, and now it looks like that:
nokogiri -versions:
# Nokogiri (1.13.6)
---
warnings: []
nokogiri:
version: 1.13.6
cppflags:
- "-I/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6-arm64-darwin/ext/nokogiri"
- "-I/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6-arm64-darwin/ext/nokogiri/include"
- "-I/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6-arm64-darwin/ext/nokogiri/include/libxml2"
ldflags: []
ruby:
version: 2.7.2
platform: arm64-darwin21
gem_platform: arm64-darwin-21
description: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [arm64-darwin21]
engine: ruby
libxml:
source: packaged
precompiled: true
patches:
- 0001-Remove-script-macro-support.patch
- 0002-Update-entities-to-remove-handling-of-ssi.patch
- 0003-libxml2.la-is-in-top_builddir.patch
- 0004-use-glibc-strlen.patch
- 0005-avoid-isnan-isinf.patch
- 0006-update-automake-files-for-arm64.patch
- '0008-htmlParseComment-handle-abruptly-closed-comments.patch'
- '0009-allow-wildcard-namespaces.patch'
libxml2_path: "/Users/ruslan/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/nokogiri-1.13.6-arm64-darwin/ext/nokogiri"
memory_management: ruby
iconv_enabled: true
compiled: 2.9.14
loaded: 2.9.14
libxslt:
source: packaged
precompiled: true
patches:
- 0001-update-automake-files-for-arm64.patch
datetime_enabled: true
compiled: 1.1.35
loaded: 1.1.35
other_libraries:
zlib: 1.2.12
libiconv: '1.16'
libgumbo: 1.0.0-nokogiri
But when I try to run specs with this version only, I have an error:
Could not find nokogiri-1.13.6 in any of the sources
Run `bundle install` to install missing gems.
So to avoid this error, I have to install Nokogiri through bundle install, but it installs the wrong version, not for the arm platform, and then I have a problem with the platform. If I install Nokogiri through the gem install command, the bundler doesn't see it.
My bundle config:
Settings are listed in order of priority. The top value will be used.
build.libv8
Set for the current user (/Users/ruslan/.bundle/config): "--with-system-v8"
build.libxml-ruby
Set for the current user (/Users/ruslan/.bundle/config): "--with-xml2-config=/usr/local/opt/libxml2/bin/xml2-config"
build.nokogiri
Set for your local app (/Users/ruslan/3commas/3commas/.bundle/config): "--use-system-libraries"
default
Set for the current user (/Users/ruslan/.bundle/config): "2.2.21"
force_ruby_platform
Set for your local app (/Users/ruslan/3commas/3commas/.bundle/config): true
Set for the current user (/Users/ruslan/.bundle/config): true
github.https
Set for the current user (/Users/ruslan/.bundle/config): "true"
Maybe somebody knows how to figure out this problem? Many thanks in advance! 🙏
I wonder if this is an issue related to the Gemfile.lock file, which can have explicit platforms to bundle for. You can check by looking for PLATFORMS within that file.
If you add Apple's ARM platform to your setup via bundler, that may help the correct version of nokogiri to be bundled? Try running the following on the command line:
bundle lock --add-platform arm64-darwin-21

Deployment to Elastic Beanstalk fails with 'Cannot allocate memory' error

I built a rails application that I want to deploy to elastic beanstalk. I was able to deploy it to my AWS account but now I want to deploy it to my clients account. For some reason it I get errors when trying to deploy it. Have been able to deploy it to my account from scratch and been able to deploy it to heroku but every time I try to deploy it to my clients account I get a bunch of errors. Are there possible settings that would be different between the two accounts? I don't understand why deploying to the two accounts would be any different. I have tried every solution I could find.
Here are the logs. I am not sure if they will help
gem 'bootstrap-sass'
gem 'autoprefixer-rails'
gem 'puma'
group :development, :test do
gem "letter_opener"
gem 'byebug'
end
group :development do
gem 'web-console', '~> 2.0'
gem 'spring'
end
group :production do
# gem 'pg'
gem 'rails_12factor'
end
+ '[' -d /var/app/ondeck/vendor/cache ']'
+ bundle install
Don't run Bundler as root. Bundler can ask for sudo if it is needed, and
installing your bundle as root will break this application for all non-root
users on this machine.
Warning: the running version of Bundler is older than the version that created the lockfile. We sugg
est you upgrade to the latest version of Bundler by running `gem install bundler`.
Fetching gem metadata from https://rubygems.org/
Fetching version metadata from https://rubygems.org/
Fetching dependency metadata from https://rubygems.org/
Using rake 11.1.2
Using i18n 0.7.0
Installing json 1.8.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/opt/rubies/ruby-2.2.5/bin/ruby -r ./siteconf20160708-498-1pc5aw8.rb extconf.rb
Cannot allocate memory - /opt/rubies/ruby-2.2.5/bin/ruby -r ./siteconf20160708-498-1pc5aw8.rb extcon
f.rb 2>&1
Gem files will remain installed in /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/json-1.8.3 for in
spection.
Results logged to /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/js
on-1.8.3/gem_make.out
Using minitest 5.9.0
Using thread_safe 0.3.5
Using builder 3.2.2
Using erubis 2.7.0
Using mini_portile2 2.1.0
Using pkg-config 1.1.7
Using rack 1.6.4
Using mime-types-data 3.2016.0521
Using arel 6.0.3
Using execjs 2.7.0
Installing bcrypt 3.1.10 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/opt/rubies/ruby-2.2.5/bin/ruby -r ./siteconf20160708-498-myt7e8.rb extconf.rb
Cannot allocate memory - /opt/rubies/ruby-2.2.5/bin/ruby -r ./siteconf20160708-498-myt7e8.rb extconf.rb 2>&1
Gem files will remain installed in /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/bcrypt-3.1.10 for inspection.
Results logged to /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/bcrypt-3.1.10/gem_make.out
Using sass 3.4.22
Using coffee-script-source 1.10.0
Using thor 0.19.1
Using concurrent-ruby 1.0.2
Using multi_json 1.12.1
Using libv8 3.16.14.15
Installing puma 3.4.0 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/opt/rubies/ruby-2.2.5/bin/ruby -r ./siteconf20160708-498-kv1g4s.rb extconf.rb
Cannot allocate memory - /opt/rubies/ruby-2.2.5/bin/ruby -r ./siteconf20160708-498-kv1g4s.rb extconf.rb 2>&1
Gem files will remain installed in /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/puma-3.4.0 for inspection.
Results logged to /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/puma-3.4.0/gem_make.out
Using bundler 1.12.1
Using rails_serve_static_assets 0.0.5
Using rails_stdout_logging 0.0.4
Using ref 2.0.0
Using tilt 2.0.5
Installing sqlite3 1.3.11 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/opt/rubies/ruby-2.2.5/bin/ruby -r ./siteconf20160708-498-5lnc3v.rb extconf.rb
Cannot allocate memory - /opt/rubies/ruby-2.2.5/bin/ruby -r ./siteconf20160708-498-5lnc3v.rb extconf.rb 2>&1
Gem files will remain installed in /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/gems/sqlite3-1.3.11 for inspection.
Results logged to /opt/rubies/ruby-2.2.5/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/sqlite3-1.3.11/gem_make.out
An error occurred while installing json (1.8.3), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.3'` succeeds before bundling. (Executor::NonZeroExitStatus)
[2016-07-08T19:47:55.300Z] INFO [424] - [Application update app-d3f5-160708_124551#2/AppDeployStage0/AppDeployPreHook/10_bundle_install.sh] : Activity failed.
[2016-07-08T19:47:55.301Z] INFO [424] - [Application update app-d3f5-160708_124551#2/AppDeployStage0/AppDeployPreHook] : Activity failed.
[2016-07-08T19:47:55.301Z] INFO [424] - [Application update app-d3f5-160708_124551#2/AppDeployStage0] : Activity failed.
[2016-07-08T19:47:55.302Z] INFO [424] - [Application update app-d3f5-160708_124551#2] : Completed activity. Result:
Application update - Command CMD-AppDeploy failed
[2016-07-08T20:17:06.267Z] INFO [1271] - [CMD-TailLogs] : Starting activity...
[2016-07-08T20:17:06.268Z] INFO [1271] - [CMD-TailLogs/AddonsBefore] : Starting activity...
[2016-07-08T20:17:06.268Z] INFO [1271] - [CMD-TailLogs/AddonsBefore] : Completed activity.
[2016-07-08T20:17:06.268Z] INFO [1271] - [CMD-TailLogs/TailLogs] : Starting activity...
[2016-07-08T20:17:06.268Z] INFO [1271] - [CMD-TailLogs/TailLogs/TailLogs] : Starting activity...
I found that the answer from #osazemeu based on the blog article needed a tweak, because the container_commands execute too late (after the application was already set up), and thus it was never run.
I changed the container_command into a command (see this AWS documentation for detail on the difference between the two), and also created the file inline rather than having a separate .sh file since I didnt want to have to keep track of what directory that was being put in at deployment time. I called the file 01setup_swap.config and placed in the directory .ebextensions in the root of my project. This did the trick for me. The contents is as follows:
files:
"/home/ec2-user/setup_swap.sh":
mode: "000755"
owner: root
group: root
content: |
#!/bin/bash
# based on http://steinn.org/post/elasticbeanstalk-swap/
SWAPFILE=/var/swapfile
SWAP_MEGABYTES=2048
if [ -f $SWAPFILE ]; then
echo "Swapfile $SWAPFILE found, assuming already setup"
exit;
fi
/bin/dd if=/dev/zero of=$SWAPFILE bs=1M count=$SWAP_MEGABYTES
/bin/chmod 600 $SWAPFILE
/sbin/mkswap $SWAPFILE
/sbin/swapon $SWAPFILE
commands:
01setup_swap:
command: "bash setup_swap.sh"
cwd: "/home/ec2-user/"
Just ran in to this error. Here is what I learned and how I got passed this issue:
With the free tier of AWS elastic beanstalk, by default the EC2 instance type you get, as of the date of this answer, is t1.micro. t1.micro has a very small amount of memory. So little that the gem install process for this gem fails as it is evident by the post. t1.micro is now considered a previous generation instance type (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html). To get past this memory allocation failure, you must update the EC2 instance of your AWS elastic beanstalk app from t1.micro to t2.micro. This worked for me.
I encountered similar issues a couple of days back and this was how I solved it. Only proceed to the next step if the present step fails.
Step 1:
Increase the swap memory of your ElasticBean EC2 instance
yourapp/.ebextensions/setup_swap.sh
#!/bin/bash
SWAPFILE=/var/swapfile
SWAP_MEGABYTES=2048
if [ -f $SWAPFILE ]; then
echo "Swapfile $SWAPFILE found, assuming already setup"
exit;
/bin/dd if=/dev/zero of=$SWAPFILE bs=1M count=$SWAP_MEGABYTES
/bin/chmod 600 $SWAPFILE
/sbin/mkswap $SWAPFILE
/sbin/swapon $SWAPFILE
Step 1.1 In your yourapp/.ebextensions/01_setup_swap.config
container_commands:
01setup_swap:
command: "bash .ebextensions/swap/setup_swap.sh"
source: elasticbeanstalk-swap
Step 2:
Increase the size of your ElasticBeanstalk instance, and try to deploy again.
Step 3:
If all else fails, run this command in your rails app.
bundle exec bundle package
This compiles the gems and saves it to a local folder (vendor/cache) in your rails app. This folder is accessed during deployment, and there will be no for compilation.
Commit these files to your repo, and attempt to deploy. It should work without hitches.

Cannot install gems on RVM JRuby gemset: SocketError: initialize: name or service not known (http://rubygems.org/specs.4.8.gz)

I'm trying to install JRuby and Ruby on Rails (or "JRuby on Rails") with RVM on GNU/Linux Debian, but I'm getting some error. This is what I have done.
First of all, I made these installations (because of the requirements that are displayed with rvm requirements):
sudo apt-get install curl g++ openjdk-6-jre-headless
sudo apt-get install ant openjdk-6-jdk
Then (the error is at the end as you can see):
pablo#martigomez:~$ rvm install jruby --1.9
jruby-1.6.7.2 - #fetching
Cloning from git://github.com/jruby/jruby.git, this may take a while depending on your connection...
Initialized empty Git repository in /home/pablo/.rvm/repos/jruby/.git/
remote: Counting objects: 197772, done.
remote: Compressing objects: 100% (45785/45785), done.
remote: Total 197772 (delta 139597), reused 196103 (delta 138126)
Receiving objects: 100% (197772/197772), 108.15 MiB | 102 KiB/s, done.
Resolving deltas: 100% (139597/139597), done.
HEAD is now at 8e849de Tag ERB specs that depend on default runs sharing a scope.
From git://github.com/jruby/jruby
* branch master -> FETCH_HEAD
Already up-to-date.
Copying from repo to src path...
jruby-1.6.7.2 - #ant jar
jruby-1.6.7.2 - #ant jar -Djruby.default.ruby.version=1.9
Building Nailgun
jruby-1.6.7.2 - #installing to /home/pablo/.rvm/rubies/jruby-1.6.7.2
jruby-1.6.7.2 - adjusting #shebangs for (jrubyc jirb_swing jirb jgem rdoc ri spec autospec testrb ast generate_yaml_index.rb).
jruby-1.6.7.2 - #importing default gemsets (/home/pablo/.rvm/gemsets/)
Copying across included gems
pablo#martigomez:~$ rvm jruby
pablo#martigomez:~$ ruby -v
jruby 1.6.7.2 (ruby-1.9.2-p312) (2012-09-24 26e08ba) (OpenJDK 64-Bit Server VM 1.6.0_18) [linux-amd64-java]
pablo#martigomez:~$ rvm --create use jruby#r328
Using /home/pablo/.rvm/gems/jruby-1.6.7.2 with gemset r328
pablo#martigomez:~$ gem list
*** LOCAL GEMS ***
pablo#martigomez:~$ gem install rails --version 3.2.8
WARNING: Error fetching data: SocketError: initialize: name or service not known (http://rubygems.org/specs.4.8.gz)
WARNING: Error fetching data: SocketError: Network is unreachable (http://rubygems.org/latest_specs.4.8.gz)
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: rdoc requires json (~> 1.4); treetop requires polyglot (>= 0), polyglot (>= 0.3.1)
I have searched but at the moment I haven't found something that helps. It is very strange that there are no gems. This is my first time with JRuby, but as I was searching on the web, when you install JRuby you suppose to have some basic gems installed, right? So what could it be the problem and the solution?
Thanks in advance!

nokogiri: relocation error in production environment

We have a build pipeline in the Rails project: we bundle and test application in the test server and then we copy it (code with gems in vendor/) to the staging server and deploy it to a passenger server.
It used to work, but now I get following error in the apache.error.log:
WARNING: Nokogiri was built against LibXML version 2.7.6, but has dynamically loaded 2.6.26
/usr/local/rvm/rubies/ruby-1.9.2-p318/bin/ruby:
relocation error: /home/project/vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.2/lib/nokogiri/nokogiri.so:
symbol xmlNextElementSibling, version LIBXML2_2.7.3 not defined in file libxml2.so.2 with link time reference
and error 500 in the browser.
When I run webbrick on the staging server U get similar errors on first request. How could I solve it?
EDIT:
Stange thing with nokogiri version. The same binary loads different libxml version depending if I call it standalone or with bundle exec:
vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.2/bin/nokogiri -v
# Nokogiri (1.5.2)
---
warnings: []
nokogiri: 1.5.2
ruby:
version: 1.9.2
platform: x86_64-linux
description: ruby 1.9.2p318 (2012-02-14 revision 34678) [x86_64-linux]
engine: ruby
libxml:
binding: extension
compiled: 2.6.26
loaded: 2.6.26
$ bundle exec vendor/bundle/ruby/1.9.1/gems/nokogiri-1.5.2/bin/nokogiri -v
WARNING: Nokogiri was built against LibXML version 2.7.6, but has dynamically loaded 2.6.26
# Nokogiri (1.5.2)
---
warnings:
- Nokogiri was built against LibXML version 2.7.6, but has dynamically loaded 2.6.26
nokogiri: 1.5.2
ruby:
version: 1.9.2
platform: x86_64-linux
description: ruby 1.9.2p318 (2012-02-14 revision 34678) [x86_64-linux]
engine: ruby
libxml:
binding: extension
compiled: 2.7.6
loaded: 2.6.26
the error really says it all. you have a different version of LibXML on your local machine (where your gem was compiled) version 2.7.6 as on your server 2.6.26 either downgrade your development machine or build your gems on the server
I resolved the problem. I built libxml2 from source and then I configured bundler to use this new version:
bundle config build.nokogiri --with-xml2-dir=/usr --with-xslt-dir=/usr/local
(Now it I have a warning, because the version that is loaded is newer that the one that was used to built Nokogiri, but it's not a problem).
If the problem persists on a 64bit bare machine, I solved it updating zlib1g from 1.2.3 to 1.2.7:
$> aptitude update
$> aptitude install zlib1g

Trying to install Ruby on Rails on OSX and I get a Gem::RemoteSourceException

What is going on when I get this "HTTP Response 403" error?
I am trying to setup Ruby on Rails on OS X 10.5.8 with XCode 3.1.4:
Boston:$ ruby --version
ruby 1.8.6 (2008-08-11 patchlevel 287) [universal-darwin9.0]
Boston:$ gem --version
1.0.1
Boston:$ sudo gem update --system
Password:
Updating RubyGems...
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 403 fetching http://gems.rubyforge.org/yaml
Boston:$ sudo gem install rubygems-update
ERROR: While executing gem ... (Gem::RemoteSourceException)
HTTP Response 403 fetching http://gems.rubyforge.org/yaml
I can't find a single specific reference online to the 403 error on OS X. I have tried adding alternate source repositories and I get the same error.
Solution Based on #Phil's Answer
I downloaded rubygems-1.3.5.zip from http://rubyforge.org/frs/?group_id=126 and unzipped the file.
Then I cd'd into the rubygems-1.3.5 directory and ran
Boston:rubygems-1.3.5$ sudo ruby setup.rb
RubyGems 1.3.5 installed
Thanks #Phil!
I just ran into this. I assume the gemcutter switchover broke old versions of rubygems (i.e. the version that comes with Leopard).
I fixed the problem by manually upgrading rubygems via http://rubyforge.org/frs/?group_id=126.

Resources