I am unable to install Rails on Cloud9 IDE - cloud9-ide

I am getting the following error
using ruby 1.9.3
gem install rails --version=4.0.0
/opt/rh/ruby193/root/usr/share/rubygems/rubygems/specification.rb:541:in `read': Permission denied - /usr/libexec/openshift/cartridges/c9-0.1/root/lib/ruby/gems/specifications/multi_json-1.8.4.gemspec (Errno::EACCES)

This is what I got from support:
"That is indeed a deployment regression that went with our latest release that's causing this issue and break new workspace creations.
We have a fix for it that should be in production in 12 hours from now.
However, a workaround would be to separate your ruby workspace's environment from our shared space installation:
edit ~/.bashrc adding the line to the end of the file (using nano or vim):
export GEM_PATH=$HOME/lib/ruby/gems
Then:
$ source ~/.bashrc
$ gem install rails -v 3.2.16
$ bundle install

Related

Mac/Xcode - pod install, pod init, pod... all error "bad interpreter: No such file or directory"

I see many, many instances of similar issues related to recent Mac OS/xCode updates with multitudes of proposed solutions that seem to work as often as not. So far, none have worked for me. Here's what i'm seeing.
I have a long-standing xCode project with cocoapods. A second developer did some updates on a different system which resulted in build errors reading:
"The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation."
When I use the terminal to attempt "pod init, pod update, pod install, pod deintegrate etc... I get:
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
The actual Ruby version that exists on my machine is 2.6, not 2.3
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby:
There is no folder on my machine located at
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby:
$ which ruby says: /usr/bin/ruby
That file does exist.
Multiple sources say that ruby installed by HOMEBREW would be found at:
/usr/local/opt/ruby/bin/ruby
There is currently no alias for Ruby in that location.
/usr/local/opt is full of folder aliases but there is no "ruby" alias
I've deleted & reinstalled the xCode commandline tools but when I try to do basically anything with homebrew (brew doctor, brew update, brew upgrade etc...)I get errors like this:
Mainframe:~ username$ brew -v
Homebrew 0.9.5
Mainframe:~ username$ brew upgrade
Traceback (most recent call last):
4: from /usr/local/Library/brew.rb:31:in `<main>'
3: from /usr/local/Library/Homebrew/os/mac.rb:15:in `version'
2: from /usr/local/Library/Homebrew/os/mac.rb:15:in `new'
1: from /usr/local/Library/Homebrew/os/mac/version.rb:24:in `initialize'
/usr/local/Library/Homebrew/version.rb:176:in `initialize': Version value must be a string (TypeError)
All of this started (apparently) because something is different on the other developers machine. I've been chasing this issue around in circles for days and getting nowhere.
Having done all of this, I'm thinking the problem lies somewhere back at the beginning with my machine looking for a Ruby 2.3 that does not exist rather than the 2.6 that DOES exist but I have no clue how to tell for sure or how to fix it.
Any help would be greatly appreciated.
Solution: Hack the pod file
Short version:
1.) Open the file at usr/local/bin/pod
2.) Change 2.3 to 2.6 in the top line
Long version:
There is an executable file located at: usr/local/bin/pod
The contents are as follows:
#!/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
#
# This file was generated by RubyGems.
#
# The application 'cocoapods' is installed as part of a gem, and
# this file is here to facilitate running it.
#
require 'rubygems'
version = ">= 0.a"
if ARGV.first
str = ARGV.first
str = str.dup.force_encoding("BINARY") if str.respond_to? :force_encoding
if str =~ /\A_(.*)_\z/ and Gem::Version.correct?($1) then
version = $1
ARGV.shift
end
end
load Gem.bin_path('cocoapods', 'pod', version)
I opened the file at: usr/local/bin/pod
and edited the first line to change 2.3 to 2.6.
This had some effect. Now if I cd into my xcode project and try to run "pod update" I get a different error.
Mainframe:graffwriter username$ pod update
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20/rbconfig.rb:229: warning: Insecure world writable dir /Users/pilotrase/bin/FDK/Tools/osx in PATH, mode 040777
Traceback (most recent call last):
2: from /usr/local/bin/pod:22:in `<main>'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:262:in `bin_path'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:283:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
The pods now seem to be missing...
I ran:
sudo gem install -n /usr/local/bin cocoapods
It seems to have worked.
I ran:
pod update
It seems to have worked.
I opened the xCode project and ran a build. The error no longer occurred and the build succeeded.
The actual Ruby version that exists on my machine
Actually, that’s the source of the problem. Under no circumstances should you use the system ruby! Use rbenv to take control of your ruby versions.
sudo gem install ...
Blap! Game over, thank you for playing. The fact that you have to say sudo is a major giveaway. This will lead to huge trouble later. Again, this is because you’re using the evil system ruby. This was always wrong. It is not intended for public use! Use rbenv and never say sudo again.

Middleman command not found/ Bundler not working

I'm trying to install middleman. I installed the gem and can see it in my gem list. However, if I enter middleman -v I get the message middleman: command not found.
I tried installing bundler to run middleman with a Gemfile in the project directory using bundle exec middleman. But when I try to run bundle I get the following error:
bash: /usr/bin/bundle: /usr/bin/ruby: bad interpreter: No such file or directory
I'm running ruby v. 2.6 and installed middleman v.4.3.5 on Ubuntu 18.04.
Any help would be very much appreciated; I've wasted half a day trying to solve this and I'm still on high waters!
which ruby gives me /snap/bin/ruby and my path variable is /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/share/rvm/bin. The problem is that ruby is in the snap folder.
I just uninstalled the ruby snap (and snaps in general) and installed "normal" Ruby, which had the correct path (usr/bin/ruby). The middleman installation then worked fine.

Trouble installing bropages on OSX

When I try to install bropages on Mavericks, I get:
$ gem install bropages
Building native extensions. This could take a while...
ERROR: Error installing bropages:
ERROR: Failed to build gem native extension.
No such file or directory # dir_chdir - /Users/christian/.gem/gems/unf_ext-0.0.6/ext/unf_ext
Gem files will remain installed in /Users/christian/.gem/gems/unf_ext-0.0.6 for inspection.
Results logged to /Users/christian/.gem/extensions/x86_64-darwin-13/2.2.0- static/unf_ext-0.0.6/gem_make.out
And then:
$ cat /Users/christian/.gem/extensions/x86_64-darwin-13/2.2.0-static/unf_ext-0.0.6/gem_make.out
No such file or directory # dir_chdir - /Users/christian/.gem/gems/unf_ext-0.0.6/ext/unf_ext
I'm using ruby 2.2.1 and gem 2.4.5, both managed with rbenv. Any idea what could cause this?
Have you tried it with sudo, I am running into the same issues as you, but my errors mentioned permissions, so I am going to go with sudo. It is strange, as I had it installed once before, and now it no longer seems to be there.
Make sure you've installed the Xcode Command Line Tools, which brings with it a bunch of utilities, including what you need to build a gem module.
xcode-select --install
After you've installed the package, give the install another go.
I guess you are using a .gemrc in your home directory, where you specify the gemhome. Instead of using a ~ for your home directory you should enter the complete path. In your example it should look as follow:
$ cat ~/.gemrc
gemhome: /Users/christian/.gem/
There must be some inconsistency between the ruby/gem tools. If you use a ~ in .gemrc, a subdirectory called /current/working/directory/~/.gem is created, while the extensions are put into your homes /home/user/.gem/ directory.

gem install metasploit-framework-db -v '4.11.0.pre.dev

Trying to install Metasploit Framework on OS X Maverick following this guide. I got to step 15, but while running bundle install the installer gets stuck on trying to install metasploit-framework -v '4.10.1.pre.dev' with the following error:
Errno::EACCES: Permission denied - metasploit-framework-db-4.11.0.pre.dev.gem
An error occurred while installing metasploit-framework-db (4.11.0.pre.dev), and
Bundler cannot continue.
Make sure that gem install metasploit-framework-db -v '4.11.0.pre.dev'
succeeds before bundling.
I know this exists, but cloning did not work for me. Running mfsupdate reads:
Using metasploit-framework-db 4.11.0.pre.dev from source at .
Tried to ran rvssudo bundle install --> ./msfconsole -->
Rails Error: Unable to access log file. Please ensure that /opt/msf/log/production.log exists and is chmod 0666.[*] Starting the Metasploit Framework console...[*] The initial module cache will be built in the background, this can take 2-5 minutes... /opt/msf/modules/payloads/singles/java/shell_reverse_tcp.rb:54:in initialize': No such file or directory - /opt/msf/data/java/metasploit/Payload.class (Errno::ENOENT)
Worried my AV Software might have caused some problems. Does anyone who has successfully installed the Metasploit Framework on OS X or Maverick have any ideas?
rvmsudo worked on mfsconsole, but this time the error reads: /opt/msf/modules/payloads/singles/java/shell_reverse_tcp.rb:54:in initialize: No such file or directory - /opt/msf/data/java/metasploit/Payload.class – aietsg Dec 31 '14 at 10:34
See below for more info
It looks as though that Gem needs more access than whatever context you are attempting the bundle install from. If you are using RVM like the blog post shows then you should try using "rvmsudo bundle install"

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.

Resources