I deployed my application using Ruby, Sinatra and Redis DataBase, on my ubuntu remote host named Scaleway.
In this way, i've install all what i need, and i can acces to my application. So when i want to use my script, who use Watir gem (selenium), it's always show me this error :
Selenium::WebDriver::Error::WebDriverError at /show_result
unable to connect to chromedriver 127.0.0.1:9515
I know that i need Xvfb (who is installed), the headless gem (that i implemented in my code), and chromedriver that i installed by the same way that i installed it on my local machine.
On my local machine, it works perfectly, but in my remote host, it show me this error above.
Did you know how to fix this problem ? How did you install Chromedriver so that my program recognizes it ?
Did you run the watir command using xvfb with something like this
xvfb-run <here is your command>
Also Chromedriver should place properly so it can be access anywhere, usually I put chromedriver at /usr/bin/ or /usr/sbin/
Here is the original question: https://community.openproject.com/topics/7851
I'm trying to install Open Project 7 in a brand new Ubuntu instance at Digital Ocean.
I've follow the instructions at https://www.openproject.org/download-and-installation/, but it's not working.
After the complete of installation and the run of the openproject configure command, i have selected options to install both MySQL and Apache server. When it's all done, i'm unable to connect to my server.
My enviroment:
Ubuntu 16.04
http://159.203.191.172
At logs, i can see two strange messages.
First:
bundler: failed to load command: unicorn (/opt/openproject/vendor/bundle/ruby/2.4.0/bin/unicorn)
Second is a warning:
WARN -- : You are setting a key that conflicts with a built-in method OmniAuth::AuthHash::InfoHash#name defined at /opt/openproject/vendor/bundle/ruby/2.4.0/bundler/gems/omniauth-8385bc0da47e/lib/omniauth/auth_hash.rb:34. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.
W, [2017-06-13T01:01:17.860764 #25822]
I don't know if the warning is related to problem, but i think that the unicorn problem is.
Answering my own question here:
I suspected that the package had some problems so i decided to install it using manual installation. The newest documentation i found was an old Ubuntu 14 step-to-step tutorial, adapted from older versions of Open Project. I decided to follow it and after a lot of adaptations i got able to finish the installation process.
This is the tutorial: https://github.com/opf/openproject-ce/blob/stable/7/docs/installation/manual/README.md
Now I'm writing another step-to-step tutorial based on it, modifying all required steps to perform a clean installation on Ubuntu 16.
i have already downloaded ruby 2.2.1 and in command prompt i hv tried the command
gem install haml
but error is coming like:
ERROR: Could not find a valid gem 'haml' (>= 0), here is why:
Unable to download data from https://rubygems.org/ - Errno::ECONNREFUS ED: No connection could be made because the target
machine actively refused it.
- connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/specs.4.8 .gz)
It might be because of the firewall company have put up in every system. I have gone through trying different proxies picked up from different websites. Can anybody tell how to install or use haml/sass?
Company firewalls, the bane of many a developer's existence.
The best thing you can do:
Talk to the local networking team and get it unblocked for direct access.
If that fails:
Do they have a proxy you can use? gem will honor proxy variables, so if you get access to one, you can do an export https_proxy="http://someaddress:someport", and then your command should work.
If that also fails
Now we're left with circumventing the network policies - Be careful, as this could get you in trouble.
Options include:
Getting an external proxy that allows port 80 (it sounds like 80 works from your question). You could set up a squid instance on your home machine and access it that way via the variable method above.
Doing an SSH tunnel through a machine that does have unrestricted internet access, and using tsocks to tunnel through there.
There are others, but these two are relatively easy to set up.
I must emphasize here, be careful! Even if your networking group is impeding your ability to do your job, either get your boss's support, or be as stealthy as possible and discontinue use of these tools once you have what you need.
If it's a rails project, you can try to change the first line of your Gemfile from source 'https://rubygems.org' to source 'http://rubygems.org'.
If you are using a ruby project, try to download gem without https, like : gem install -s http://rubygems.org haml
I have an Ubuntu workstation and i'm trying to bootstrap a windows node. The windows node has ssh open on port 2222. I've been following http://docs.opscode.com/plugin_knife_windows.html.
ateetor#ateetor-virtual-machine:~/chef/chef-repo$ sudo gem install knife-windows --http-proxy=[REMOVED]
Successfully installed knife-windows-0.5.12
1 gem installed
Installing ri documentation for knife-windows-0.5.12...
Installing RDoc documentation for knife-windows-0.5.12...
ateetor#ateetor-virtual-machine:~/chef/chef-repo$ sudo knife bootstrap windows ssh 10.29.3.114 -x chef -P SSHuser1! -N test -p 2222 -VV
DEBUG: Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
DEBUG: Found bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
Bootstrapping Chef on windows
DEBUG: Adding windows
DEBUG: establishing connection to windows:2222
ERROR: Network Error: getaddrinfo: Name or service not known
Check your knife configuration and network settings
To me what that looks like is it's trying to use the word windows as part of the IP; however my syntax matches the guide so i don't know why. Does anyone have any ideas on how to fix this?
If you look at the output it's running the generic bootstrap template.
Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/chef-11.4.4/lib/chef/knife/bootstrap
Most likely there is an installation or ruby environment issue resolving the knife-windows gem.
When correctly configured you should see:
Looking for bootstrap template in /opt/chef/embedded/lib/ruby/gems/1.9.1/gems/knife-windows-0.5.12/lib/chef/knife/bootstrap
The only fix I have found is to use knife from a windows workstation instead of a linux one.
knife bootstrap windows winrm 111.22.33.44.compute-1.amazonaws.com -x Administrator -P "asdklfj329" -N "windows-2008-551"
Enjoy :)
I have faced the similar issue.One of the reasons for this might be you knife-windows gem package is not installed in expected location.
knife-windows resolves target hostname ,if its not properly installed winrm knife cant resolve targetname.So to overcome this install knife-windows as below
To install the knife windows plugin using RubyGems, run the following command:
$ /opt/chef/embedded/bin/gem install knife-windows
if properly installed you should be able to find knife-windows at
/opt/chef/embedded/lib/ruby/gems/1.9.1/gems/
The firewall I'm behind is running Microsoft ISA server in NTLM-only mode. Hash anyone have success getting their Ruby gems to install/update via Ruby SSPI gem or other method?
... or am I just being lazy?
Note: rubysspi-1.2.4 does not work.
This also works for "igem", part of the IronRuby project
For the Windows OS, I used Fiddler to work around the issue.
Install/Run Fiddler from www.fiddler2.com
Run gem:
$ gem install --http-proxy http://localhost:8888 $gem_name
I wasn't able to get mine working from the command-line switch but I have been able to do it just by setting my HTTP_PROXY environment variable. (Note that case seems to be important). I have a batch file that has a line like this in it:
SET HTTP_PROXY=http://%USER%:%PASSWORD%#%SERVER%:%PORT%
I set the four referenced variables before I get to this line obviously. As an example if my username is "wolfbyte", my password is "secret" and my proxy is called "pigsy" and operates on port 8080:
SET HTTP_PROXY=http://wolfbyte:secret#pigsy:8080
You might want to be careful how you manage that because it stores your password in plain text in the machine's session but I don't think it should be too much of an issue.
This totally worked:
gem install --http-proxy http://COMPANY.PROXY.ADDRESS $gem_name
I've been using cntlm (http://cntlm.sourceforge.net/) at work. Configuration is very similar to ntlmaps.
gem install --http-proxy http://localhost:3128 _name_of_gem_
Works great, and also allows me to connect my Ubuntu box to the ISA proxy.
Check out http://cntlm.wiki.sourceforge.net/ for more information
I tried some of these solutions, and none of them worked. I finally found a solution that works for me:
gem install -p http://proxy_ip:proxy_port rails
using the -p parameter to pass the proxy. I'm using Gem version 1.9.1.
Create a .gemrc file (either in /etc/gemrc or ~/.gemrc or for example with chef gem in /opt/chef/embedded/etc/gemrc) containing:
http_proxy: http://proxy:3128
Then you can gem install as usual.
This solved my problem perfectly:
gem install -p http://proxy_ip:proxy_port compass
You might need to add your user name and password to it:
gem install -p http://[username]:[password]#proxy_ip:proxy_port compass
If you are having problems getting authenticated through your proxy, be sure to set the environment variables in exactly the format below:
set HTTP_PROXY=some.proxy.com
set HTTP_PROXY_USER=user
set HTTP_PROXY_PASS=password
The user:password# syntax doesn't seem to work and there are also some badly named environment variables floating around on Stack Overflow and various forum posts.
Also be aware that it can take a while for your gems to start downloading. At first I thought it wasn't working but with a bit of patience they started downloading as expected.
Quick answer : Add proxy configuration with parameter for both install/update
gem install --http-proxy http://host:port/ package_name
gem update --http-proxy http://host:port/ package_name
I tried all the above solutions, however none of them worked. If you're on linux/macOS i highly suggest using tsocks over an ssh tunnel. What you need in order to get this setup working is a machine where you can log in via ssh, and in addition to that a programm called tsocks installed.
The idea here is to create a dynamic tunnel via SSH (a socks5 proxy). We then configure tsocks to use this tunnel and to start our applications, in this case:
tsocks gem install ...
or to account for rails 3.0:
tsocks bundle install
A more detailed guide can be found under:
http://blog.byscripts.info/2011/04/bypass-a-proxy-with-ssh-tunnel-and-tsocks-under-ubuntu/
Despite being written for Ubuntu the procedure should be applicable for all Unix based machines. An alternative to tsocks for Windows is FreeCap (http://www.freecap.ru/eng/). A viable SSH client on windows is called putty.
Posts abound regarding this topic, and to help others save hours of trying different solutions, here is the final result of my hours of tinkering.
The three solutions around the internet at the moment are:
rubysspi
apserver
cntlm
rubysspi only works from a Windows machine, AFAIK, as it relies on the Win32Api library. So if you are on a Windows box trying to run through a proxy, this is the solution for you. If you are on a Linux distro, you're out of luck.
apserver seems to be a dead project. The link listed in the posts I've seen lead to 404 page on sourceforge. I search for "apserver" on sourceforge returns nothing.
The sourceforge link for cntlm that I've seen redirects to http://cntlm.awk.cz/, but that times out. A search on sourceforge turns up this link, which does work: http://sourceforge.net/projects/cntlm/
After downloading and configuring cntlm I have managed to install a gem through the proxy, so this seems to be the best solution for Linux distros.
A workaround is to install http://web.archive.org/web/20060913093359/http://apserver.sourceforge.net:80/ on your local machine, configure it and run gems through this proxy.
Install: Just download apserver 097 (and not the experimental 098!) and unpack.
Configure: Edit the server.cfg file and put the values for your MS proxy in PARENT_PROXY and PARENT_PROXY_PORT. Enter the values for DOMAIN and USER. Leave PASSWORD blank (nothing after the colon) – you will be prompted when launching it.
Run apserver: cd aps097; python main.py
Run Gems: gem install—http-proxy http://localhost:5865/ library
I am working behind a proxy and just installed SASS by downloading directly from http://rubygems.org.
I then ran sudo gem install [path/to/downloaded/gem/file]. I cannot say this will work for all gems, but it may help some people.
This worked for me in a Windows box:
set HTTP_PROXY=http://server:port
set HTTP_PROXY_USER=username
set HTTP_PROXY_PASS=userparssword
set HTTPS_PROXY=http://server:port
set HTTPS_PROXY_USER=username
set HTTPS_PROXY_PASS=userpassword
I have a batch file with these lines that I use to set environment values when I need it.
The trick, in my case, was HTTPS_PROXY sets. Without them, I always got a 407 proxy authentication error.
If you are on a *nix system, use this:
export http_proxy=http://${proxy.host}:${port}
export https_proxy=http://${proxy.host}:${port}
and then try:
gem install ${gem_name}
rubysspi-1.3.1 worked for me on Windows 7, using the instructions from this page:
http://www.stuartellis.eu/articles/installing-ruby/
If you want to use SOCKS5 proxy, you may try rubygems-socksproxy https://github.com/gussan/rubygems-socksproxy.
It works for me on OSX 10.9.3.
If behind a proxy, you can navigate to Ruby downloads, click on Download, which will download the specified update ( or Gem ) to a desired location.
Next, via Ruby command line, navigate to the downloaded location by using : pushd [directory]
eg : pushd D:\Setups
then run the following command: gem install [update name] --local
eg: gem install rubygems-update --local.
Tested on Windows 7 with Ruby update version 2.4.1.
To check use following command : ruby -v
Rather than editing batch files (which you may have to do for other Ruby gems, e.g. Bundler), it's probably better to do this once, and do it properly.
On Windows, behind my corporate proxy, all I had to do was add the HTTP_PROXY environment variable to my system.
Start -> right click Computer -> Properties
Choose "Advanced System Settings"
Click Advanced -> Environment Variables
Create a new System variable named "HTTP_PROXY", and set the Value to your proxy server
Reboot or log out and back in again
Depending on your authentication requirements, the HTTP_PROXY value can be as simple as:
http://proxy-server-name
Or more complex as others have pointed out
http://username:password#proxy-server-name:port-number
for anyone tunnelling with SSH; you can create a version of the gem command that uses SOCKS proxy:
Install socksify with gem install socksify (you'll need to be able to do this step without proxy, at least)
Copy your existing gem exe
cp $(command which gem) /usr/local/bin/proxy_gem
Open it in your favourite editor and add this at the top (after the shebang)
require 'socksify'
if ENV['SOCKS_PROXY']
require 'socksify'
host, port = ENV['SOCKS_PROXY'].split(':')
TCPSocket.socks_server = host || 'localhost'
TCPSocket.socks_port = port.to_i || 1080
end
Set up your tunnel
ssh -D 8123 -f -C -q -N user#proxy
Run your gem command with proxy_gem
SOCKS_PROXY=localhost:8123 proxy_gem push mygem