UAAC command line-utility not work - ruby

We are working on Predix Mobile SDK.So we are try to set Predix Mobile Development Environment for that we need set UAAC command line-utility .We flowed this link (https://github.com/cloudfoundry/cf-uaac).
For Install we tried like this
gem install cf-uaac
We got error this
ERROR: While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.
after that we google about this error but we got nothing .Please guide to us for UAAC CLI.

The cloud foundry cf-uaac cli tool is written in Ruby, so installation is done with gem, the ruby package manager.
You can run gem env from a terminal to find the installation directory for gems which is probably /usr/bin in your case. You wouldn't want to install your gems there as only root has permission to write. If you are on OSX there may even be more to the story.
I'm not sure what OS you are using so can't be too prescriptive, but a few suggestions for you can be found in this previous question to override this default behavior on your system:
Override install location on the commandline --user-install cf-uaac
Edit your ~/.gemrc to include something like this or change to one of the GEM PATHS
Re-install ruby to a different location where you do have write permission
Use ruby version manager rvm if you will be doing lots of ruby dev work and want to switch versions / gems
You can find out lots more about the install command in the rubygems guide if you were interested in learning more.
Hope that gets you going again.

UAAC is the Ruby-based command line interface (CLI) for interacting with the Cloud Foundry User Account and Authentication (UAA)
first install Ruby, you can follow the guidelines (steps 1 & 2) from here:
Ruby for Windows
then run this commend from powershell:
gem install cf-uaac
If you are behind a proxy you should add the source:
gem sources -a http://rubygems.org

Related

How to fix gem permission error after installing rbenv?

I was trying to install Sinatra and I kept on getting this error: You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory
Thanks to "Installing gem or updating RubyGems fails with permissions error" I installed rbenv. I followed the guide and set my global ruby version, etc. but I continue to get the same error when I try to install gems. When I run gem environment the installation directory for RubyGems is still the system Ruby directory.
Should I update GEM_PATH? Since the rbenv guide doesn't mention anything about that, something makes me think that there is still a problem with my rbenv installation.
Can someone please help me figure this out?
You're not showing us the commands you're using but it smells like you're using sudo to install Sinatra. Don't do that with rbenv or RVM managed Rubies.
Just as in the linked question, using rbenv or RVM allows you have one or more Rubies in your user-space where you can modify them all you want. That means you don't need to use sudo, just use gem install ....
An alternate problem you could be having is you set your global Ruby to be system, which is the version installed by Apple for their use, and which you don't want to modify unless you understand why it's there and what they're using it for. IF you have to change it then sudo would be appropriate but, with rbenv or RVM managing Rubies in your user-space there's really no reason to.
Do NOT use chmod to change the ownership of the vendor installed gems; Again, that's for Apple's use so have fun with the local Rubies instead and leave Apple's alone.
In this case, I quit Terminal and upon reopening, things were working correctly. Probably a good thing to try if you're stuck and are sure you've followed instructions correctly. It's not explicitly mentioned in the material I read but I believe is a good practice in general.

Error when using overcommit and Github Desktop

I am using overcommit gem (https://github.com/brigade/overcommit) in my project, when I use Github Desktop for osx I get these errors:
This repository contains hooks installed by Overcommit, but the
overcommit gem is not installed. Install it with gem install
overcommit. (1)
The gem is installed, it works in terminal. I guess it's because I use rvm and Github Desktop doesn't know about rvm. Anybody knows how to fix this?
Ok finally got it to work!
Combined the answer from #michelegera with comment from #rewritten
Step 1:
sudo su -
gem install bundler
gem install overcommit
gem install rubocop
Step 2: added command: ['bundle', 'exec', 'rubocop'] to .overcommit.yml
Thanks for the help!
Most likely it's this line where the error occurs. As you can see the main issue is that it's not able to require 'overcommit'. I don't know the GitHub desktop client so well (maybe there is a way to configure it inside of it), but one thing you could do is adding the absolute path where rvm stores your gems to the "require path" in the hook file. This could look like:
$: << "/home/user/.rvm/path/to/gems/dir"
The disadvantage of this is that you would have your absolute path in the hook file and it most likely won't work for others. You might also want to consider installing the gem globally for the the ruby interpreter that executes the script (see Shebang line in the hook file).
You are right, Github Desktop (or any other GUI) isn’t running in your terminal environment, so it knows nothing about your specific RVM installation.
A simple solution is to install overcommit and any other gems required by your hooks into your system Ruby:
sudo su -
gem install bundler
gem install overcommit
gem install rubocop
...
If you installed Git via Homebrew or other means, you might have to change the Git binary used by your GUI.
For example, in Tower, I selected Homebrew’s version rather than the System’s.

ERROR: While executing gem ... (Zlib::GzipFile::Error) not in gzip format

I am developing a Sencha touch 2 application. I have been following the "Styling the user interface of a Sencha Touch application" tutorial on theming of secha touch applications.
It requires me to install Ruby, Compass and SASS.
I installed Ruby using the installer from rubyinstaller.org.
On executing the following command, I get the expected result which confirms correct installation:
C:\>ruby -v
ruby 1.9.3p327 (2012-11-10) [i386-mingw32]
Current source is up to date:
C:\>gem sources
** CURRENT SOURCES **
http://rubygems.org/
Next, since I am behind a proxy, I used the following command to install HAML/Compass:
C:\>gem install -p [proxy:port] compass
ERROR: While executing gem ... (Zlib::GzipFile::Error)
not in gzip format**
Can someone help me? I found solutions such as system update, gem sources update, but everything is up to date on my system.
Edit:
C:\>gem install compass
works perfectly fine on my private system. When I try the same command from my workplace I need to use the proxy as mentioned above and that results in an error.
I assume the ERROR occurs since the web sense at my workplace blocks these downloads.
Solution: I downloaded the required gems: chunky_png, fssm, compass, sass, haml etc.. directly from http://rubygems.org/gems and placed these gems in my local directory.
After this I tried gem install compass. This first searches your local directory. On finding the required gems, installation takes place. Does not require connection to the ruby website.
Note: Run the command from the path where the gems are located
eg: I have placed the gems in C:\Ruby193\lib\ruby\gems\1.9.1\gems
So I run the following command :
C:\Ruby193\lib\ruby\gems\1.9.1\gems>gem install compass
I had a similar problem, it worked on my own private laptop, but failed while using a virtual server at work (running Ubuntu 12.10) that used a proxy.
Following the suggestion I found here, from the command line I defined:
export HTTPS_PROXY=proxy-address:proxy-port-number
export HTTP_PROXY=proxy-address:proxy-port-number
and then my gem install package worked fine.

"Quick Install Gem" not working on RubyMine

I've just done a fresh install of RubyMine 4.5 in order to get a quickstart on Rails dev.
Whenever I try and install any Gem using the Tools > Quick Install Gem... command, I get the following error (below is specific to the flickraw gem)
Failed to Install Gems
Following gems were not installed:
flickraw(0.9.6): While executing gem ...
(Errno::EACCESS)
Permission denied - /Users/Andy/.rvm/gems/ruby-1.9.3-p194/cache/flickraw-0.9.6.gem
I guess I get that it's a permissions error...but why is it happening, shouldn't this just work? And how do I fix it?
I'm running this on the latest version of OSX Mountain Lion.
I've had similar problems before, it turned out to be caused by sudo being the owner of some gems installed in that rvm ruby installation I was using. I guess I installed something with sudo by accident, I dunno-- but go check in /Users/Andy/.rvm/gems/ruby-1.9.3-p194/cache and /Users/Andy/.rvm/gems/ruby-1.9.3-p194/gems and see if sudo owns cache/flickraw-0.9.6.gem or any folders in gems and if needed change the owner and group back to you ... I actually had so many messed up I opted to just remove and rebuild that ruby.

Error installing AWS SDK for Ruby on Mac

I'm learning Ruby to access an AWS SDB created by my partner. When I installed the AWS SDK for Ruby on my Mac, I got the following message:
WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
/usr/bin aren't both writable.
WARNING: You don't have /Users/royclymer/.gem/ruby/1.8/bin in your PATH,
gem executables will not run.
I'm familiar with "PATH" from my PC days but have just started using Terminal on the Mac (to run Ruby) and can't find PATH command there. Maybe this isn't a problem, because it did say "six gems installed" but I also got several statements like "No definition for get_options."
Thanks.
It sounds like you are trying to install a gem into your system install ruby. You can likely resolve this issue by prefixing the gem install command with sudo.
sudo gem install aws-sdk
While this should work, its generally better to use a different solution that does not require installing gems as root (try googling rvm and rbenv).
PATH is not a command, it's an environment variable. To see the current content, do echo $PATH in your terminal. To temporarily change your PATH you can just re-export it like so:
export PATH=~/.gem:$PATH
For a permanent change you may want to read up on .bash_profile or .bashrc as well as /etc/paths and /etc/paths.d/.

Resources