Error with rhc-create-domain on command line (Openshitft) - ruby

First I do not know much about Ruby, but, the Openshit command line uses the 'rhc' to manage my apps on cloud. Nice!...but the 'rhc' program its based on Ruby, Rubygems....something.
Ok, i'm installed theses programs with apt-get on Linux Mint (Ubuntu based):
sudo apt-get install ruby1.8
sudo apt-get install gem
sudo apt-get install rubygems
gem install json_pure
gem install rake
gem install rhc
Nice!..rhc its visible in my console, but when i try execute any rhc command, the console returns for me this:
rhc-create-domain -n carlosjr -l carlosjrcabello#gmail.com
/usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:247:in `to_specs': Could not find rhc (>= 0) amongst [json-1.6.6, json_pure-1.6.6, mime-types-1.18, parseconfig-0.5.2, rest-client-1.6.7] (Gem::LoadError)
from /usr/local/lib/site_ruby/1.8/rubygems/dependency.rb:256:in `to_spec'
from /usr/local/lib/site_ruby/1.8/rubygems.rb:1231:in `gem'
from /usr/local/bin/rhc-create-domain:18
Remembering, i do not know if I have to update something in ruby or RubyGem.
No more for now. Thanks.

I solved the problem. The Linux Mint 12 (Lisa) with KDE contains the basic Ruby packages installed, so I purged all ruby packages before installing all required RHC apps. Here is my solution (in command line):
sudo apt-get purge ruby* (caution with grub packages)
sudo reboot
sudo apt-get install ruby1.8
sudo apt-get install gem
sudo apt-get install rubygems
gem install json_pure
gem install rake
gem install rhc
All rhc functionalities should now be working.
PS: I think that Openshift can be explain more the install process of Ruby apps..using my case for example, I dont have anything knowledge of Ruby :/

I had the same error message on Ubuntu 12.04. In my case the problem was /var/lib/gems/ was not world readable.

Related

Error occured while installing unf_ext (0.0.7.4), and Bundler cannot continue

My ultimate goal is to get this to work in an Ubuntu 14.04 Docker container: https://github.com/byalextran/autoluv
When I run
m1#9bdc67007b49:~/autoluv$ bundle install --deployment
It says:
Fetching unf_ext 0.0.7.4
Installing unf_ext 0.0.7.4 with native extensions
Errno::EACCES: Permission denied # rb_sysopen - /home/m1/autoluv/vendor/bundle/ruby/2.4.0/gems/unf_ext-0.0.7.4/.document
An error occurred while installing unf_ext (0.0.7.4), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.7.4' --source 'https://rubygems.org/'` succeeds before bundling.
But when I run
sudo gem install unf_ext -v '0.0.7.4' --source 'https://rubygems.org/'
unf_ext-0.0.7.4 installs fine?
Building native extensions. This could take a while...
Successfully installed unf_ext-0.0.7.4
1 gem installed
Installing ri documentation for unf_ext-0.0.7.4...
Installing RDoc documentation for unf_ext-0.0.7.4...
I cannot figure out the next step. I've tried installing ruby-dev and gcc, but neither has helped move this along :(
Any and all help is much appreciated!
I had this same problem and the reason was that I did not installed all the dependencies that bundler needs to run
just try to:
sudo apt-get install build-essential
then run again
gem install bundler
and lastly
bundler
There is a difference between running commands with sudo and without. You can get more info about this command here https://kb.iu.edu/d/amyi.
Errno::EACCES usually happens when bunder has no access to a needed folder or it doesn't exist.
Try to gem install unf_ext -v '0.0.7.4' --source 'https://rubygems.org/' without sudo.
I had same issue on Fedora.
I simply had to install the gcc-c++ package.
I solved this error on Debian 10 buster in my ChromeOS Linux container by installing rbenv: sudo aptitude install rbenv or sudo apt install rbenv.
Aptitude package manager seems to be better at resolving dependencies and allowing me to install newer packages more easily than the default apt so I thought it was worth mentioning.
Solved it after using following commands for Xcode 13, BigSur :
softwareupdate --install a
sudo port upgrade outdated
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install wget
brew install build-essentials
bundler install
If you are an iOS developer who is getting this error, this might be related to your Xcode command line tools selection.
Just run the following command with the path of the Xcode that you are using currently.
sudo xcode-select --switch /Applications/Xcode.app
You need to use the latest version of Ruby.
If you are using MacOS, system Ruby is old and outdated. you can not update the system Ruby, but you can install another version of Ruby and make it default global using rbenv ruby version manager tool.
finally you can install any ruby packages you like.

I want to run wpscan on Ubuntu vps server, but getting ruby errors

Firstly i installed wpscan on ubuntu by following these methods
apt-get install git
sudo apt-get install libcurl4-openssl-dev libxml2 libxml2-dev libxslt1-dev ruby-dev build-essential libgmp-dev zlib1g-dev
git clone https://github.com/wpscanteam/wpscan.git
cd wpscan
sudo gem install bundler && bundle install --without test development
Then when i run it by typing ruby wpscan.rb
it said
Could not find ffi-1.9.18 in any of the sources
Run `bundle install` to install missing gems.
when i run bundle install i got that output
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.4.0/gems/ffi-1.9.18 for
inspection.
Results logged to
/var/lib/gems/2.4.0/extensions/x86_64-linux/2.4.0/ffi-1.9.18/gem_make.out
An error occurred while installing ffi (1.9.18), and Bundler cannot
continue.
Make sure that `gem install ffi -v '1.9.18'` succeeds before bundling.
In Gemfile:
typhoeus was resolved to 1.3.0, which depends on
ethon was resolved to 0.10.1, which depends on
Help will be appreciated , thanks
INSTALL RMV
Pre-requisites
sudo apt-get install software-properties-common
Add the PPA and install the package
sudo apt-add-repository -y ppa:rael-gc/rvm
sudo apt-get update
sudo apt-get install rvm
sudo usermod -a -G rvm $USER
Change your terminal window
At terminal window, click Edit > Profile Preferences, click on Title and Command tab and check Run command as login shell.
Edit Profile
3.Reboot
A lot of changes were made (scripts that needs to be reloaded, you're now member of rvm group) and in order to properly get all them working, you need to reboot (in most cases a logout/login is enough, but in some Ubuntu derivatives or some terminal emulators, a shell login is not performed, so we advise to reboot).
Enable local gemsets
Now enable local gemsets. Open a terminal (Ctrl+Alt+T) and run:
rvm user gemsets
Install a ruby
Now you're ready to install rubies. Open a terminal (Ctrl+Alt+T) and run:
rvm install ruby
RVM Usage
man rvm
INSTALL - WPSCAN
From RubyGems
gem install wpscan
You can update the local database by using
wpscan --update
Enumerating usernames
wpscan --url https://target.tld/ --enumerate u
Enumerating a range of usernames
wpscan --url https://target.tld/ --enumerate u1-100
Doc>> https://github.com/wpscanteam/wpscan/wiki/WPScan-User-Documentation

Installing Compass & Susy on Ubuntu 12.04

I'm trying to install Compass and Susy on my Ubuntu 12.04.
What I have tried are the following steps on the console:
sudo apt-get install rubygems1.8
sudo gem install rubygems-update # Instead of sudo gem update --system
sudo update_rubygems
sudo gem install compass # Installing Compass & Sass
sudo gem install susy
So the gems are installed and will be listed when I do the following command:
gem list
But now, when I try to create a new compass project with
compass create project
I get the following error:
/usr/local/bin/compass: /usr/bin/ruby1.9.1: bad interpreter: No such file or directory
My current ruby version is 1.8.7. So I installed ruby 1.9.1 and get it working.
The console still says the current ruby version is 1.8.7
My question: Do I have to run with both ruby versions to get that working? Is there another way under ubuntu? It's working, I know, but it's a bit confusing.
Using Ubuntu's package manager for multiple ruby versions is a bit of a lost cause.
Most people use rvm, which allows you to install and switch between multiple rubies very easily.
Other popular options are rbenv and chruby. It's just a question of personal preference, but I'd say that rvm has the slight edge for beginners.
Also, I wouldn't recommend installing ruby 1.9.1 - it's best to use 1.9.3 as there are some compatibility issues with other 1.9.x versions.
You can then install compass and sass via ruby gems (rather than aptitude):
$ gem install compass
$ gem install sass
This simple command works on ubuntu 14.10
sudo apt-get install ruby-compass
RVM is awesome and really easy to install. I managed to install rvm, compass, and sass with these commands in my terminal:
Firstly:
curl -L https://get.rvm.io | bash -s stable --rails --autolibs=enabled --ruby=1.9.3
This will instal rvm, it will put a command in ~/.bash_profile to load rvm automatically, except this isn't what Ubuntu uses so put this line into your ~/.bashrc file:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
Then simply run:
gem install compass
gem install susy #(or sass)
Install build-essentials and ruby-dev packages to install compass without errors.
sudo apt-get install build-essential
sudo apt-get install ruby
sudo apt-get install ruby-dev
sudo gem install compass
Masterchief's answer is close, but didn't work for me. This web page provided a clear and reliably working way to install rvm on my ubuntu server instance: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

Failed to build gem native extension when install RedCloth-4.2.9 install Linux

I want to install Octopress in my computer.
I try to do it like
Octopress document.
When I run
bundle install
I got error message
An error occured while installing RedCloth (4.2.9), and Bundler cannot continue.
Make sure that `gem install RedCloth -v '4.2.9'` succeeds before bundling.
So, I run
sudo gem install RedCloth -v '4.2.9'
then, I got a error message again:
ERROR: Error installing RedCloth:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from extconf.rb:1:in `<main>'
I hadn't learn any knowledge about ruby.
My ubuntu 12.04 solution is install the ruby1.9.1-full version, that can resolve this issue.
sudo apt-get install ruby1.9.1-full
you can execute command:
sudo update-alternatives --config ruby
to select the altiernative ruby which you have installed.
and then, execute below commands to finish the octopress deploy:
git clone https://github.com/erizhang/octopress.git octopress
cd octopress/
sudo gem install bundler
sudo gem install RedCloth -v '4.2.9'
bundle install
rake install
below commands you can find from octopress deploy guideline page:
rake setup_github_pages
sudo rake setup_github_pages
sudo rake generate
sudo rake deploy
Hope it's helpful for you, thanks
I was installing Octopress too and got the same problem as yours. After checking the mkmf.log file I figured out that gcc-4.2 had not been found. I Even installed xcode with the command line tools. It worked when I made a symlink like this:
$ sudo ln -s /usr/bin/gcc /usr/bin/gcc-4.2
$ bundle install
I fixed this issue by running
sudo apt-get install ruby-dev
as described in this blog post.
You've probably upgraded to Mountain Lion and have not rebuilt your ruby-1.9.2 install yet with the new development packages.
rvm --force install 1.9.2
gem install bundle --no-ri --no-rdoc
bundle install
If you don't have the Mountain Lion dev packages installed correctly, use the ThoughtBot instructions.
For Ubuntu 14.04 simply do this:
sudo apt-get install ruby1.9.3
Should work for 13.10 and 13.04 too. (Not tested)
it apears you are not using rvm for managing your ruby installation. I think best would be to try rvm, here's a very good guide, you can stop without installing rails: ruby with rvm
Then simply
$gem install RedCloth
Unmanaged ruby gems are a pain, I try to avoid them.
None of the answers worked on my Ubuntu 14.04.1 LTS. Upgrade to ruby 2.0 fixed the problem for me:
sudo apt-get install ruby2.0 ruby2.0-dev
sudo ln -s /usr/bin/ruby2.0 /usr/bin/ruby
sudo ln -s /usr/bin/gem2.0 /usr/bin/gem
sudo gem install bundler
Make sure you also have the build-essential package installed. You can check using
dpkg -l | grep build-essential
or simply install it without checking
sudo apt-get install build-essential
For me on Ubuntu 14.04.1 LTS, after making sure build-essential is installed, the bundle install command works/builds fine also with Ruby 1.9.3.

Ruby gem permission denied /var/lib/gems using Ubuntu

I'm trying to install Rails using Gem and did the following from the terminal:
sudo apt-get install ruby-full build-essential
sudo apt-get install rubygems
export PATH=/var/lib/gems/1.8/bin:$PATH
gem install rails
Then I get the following message:
ERROR: While executing gem ... (Errno:EACCES)
Permission denied - /var/lib/gems
I've followed the instruction from Ubuntu Help Guide & I'm using Oracle VM VirtualBox to run Ubuntu under Windows 7 and have RubyGems v1.8.15.
You need to prefix the gem command with sudo because /var/lib/gems is owned by root. You could also take a look at RVM which allows really easy installation and management of gems and Ruby versions. Best part, it's all in your home dir!
EDIT: per #AndrewMarshall's comment bellow, rbenv is an alternative to RVM.

Resources