can't setup ruby environment - installing fii gem error
Make sure that you have installed Apple Xcode and Command Line Tools (look at this screenshot):
https://developer.apple.com/technologies/tools/
After that, don't forget to install libffi.
1) if you are using homebrew
brew install libffi
2) if you are using macport
sudo port install libffi
Issue with gems in RVM, Ruby and Rails installation
The problem stemmed from my installation of Ruby. Apparently, as stated in this answer, "a non-LLVM version of GCC" is no longer included in the XCode command line tools.
Installing ruby with:
rvm install ruby --with-gcc=clang
Worked and I installed RVM, Ruby and Rails within about 10 minutes, despite it taking me a week of debugging and reinstalling otherwise.
An error occurred while installing json (1.8.6), and Bundler cannot continue
This can be solved by doing the following
1. Installing the ruby development environment by running the following command(for Linux machines).
sudo apt-get install ruby
ruby -e 'puts RUBY_VERSION[/\d+\.\d+/]' -dev
Read this post for more details.
2. Now install the json -v '1.8.6'
gem by running the following command.
sudo gem install json -v '1.8.6'
This should solve the issue. Now try running bundle update
and bundle install
and it should work fine.
Thanks @TomLord and @Haider Ali for your inputs.
Can't install pg gem on Windows
The message you're getting is a clear indication that you lack something for the correct installation of that gem:
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
There is no Windows native version of latest release of pg (0.10.0) released yesterday, but if you install 0.9.0 it should install binaries without issues.
Anyhow, if you want to install the gem, you need a build environment installed. If you're using RubyInstaller, then you need the DevKit
Installation of the gem will only require you provide additional options to gem installation (like --with-pg-dir
)
subst X: "C:\Program Files (x86)\PostgreSQL\8.3"
gem install pg -- --with-pg-dir=X:
subst X: /D
How to solve xcpretty uncaught Exception
After a quality time research I did not get any solution but below code which I customize is working fine for me.
sudo gem install -n /usr/local/bin xcpretty
Elastic Beanstalk: can't find gem bundler (= 0.a) with executable bundle (Gem::GemNotFoundException)
So here's the programmatic solution to the above problem. Create the below file under .ebextensions/gem_install_bundler.config
:
files:
# Runs before `./10_bundle_install.sh`:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/09_gem_install_bundler.sh" :
mode: "000775"
owner: root
group: users
content: |
#!/usr/bin/env bash
EB_APP_STAGING_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_staging_dir)
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
# Source the application's ruby, i.e. 2.6. Otherwise it will be 2.3, which will give this error: `bundler requires Ruby version >= 2.3.0`
. $EB_SCRIPT_DIR/use-app-ruby.sh
cd $EB_APP_STAGING_DIR
echo "Installing compatible bundler"
gem install bundler -v 2.0.1
Then when you next eb deploy
, the bundler will have been updated to version 2.0.1, and you won't get the above error again.
More information in the docs here:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/custom-platform-hooks.html
and here:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html#linux-files
Last note: Ensure that you either commit these changes before running eb deploy
, or stage them and run eb deploy --staged
. See: https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-cli-git.html. I learned this the hard way!
Related Topics
Include Erb Delimiters Inside of a String in an Erb Block
Error Creating Rails Db Using Rake Db:Create
Project Euler #3 in Ruby Solution Times Out
+= Operator Appears to Modify Frozen String
How to Use Headless Chrome with Capybara and Selenium
Can't Run Ruby 2.2.3 with Rvm on Osx
What Are Fast Xml Parsers for Ruby
Single Quote String String Interpolation
Find Both Pattern and Position of Multiple Regex Matches in Ruby
Getting Count of Elements by 'Created_At' by Day in a Given Month
Ruby Converting Utc to User's Time Zone
Gets.Chomp Without Moving to a New Line
Can't Setup Ruby Environment - Installing Fii Gem Error
Monitor Ruby Processes with Monit
Ruby: Automatically Set Instance Variable as Method Argument