-
Notifications
You must be signed in to change notification settings - Fork 508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gracefully handle files with UTF-8 BOM #225
Conversation
* origin/master: Fix rubocop offenses Added jruby-head don't assume `ruby`
Doesn't work for me with Bundler (I run cmd with admin rights!): C:\Users\Suriyaa\Downloads\platform-samples\api\ruby\basics-of-authentication>bu
ndle install
DL is deprecated, please use Fiddle
Updating git://github.com/bkeepers/dotenv.git
fatal: '/cygdrive/c/Users/Suriyaa/Downloads/platform-samples/api/ruby/basics-of-
authentication/C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/cache/bundler/git
/dotenv-144e50b5b44d79bf4881c97e23671703b3ecbdf0' does not appear to be a git re
pository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Retrying git clone --no-checkout --quiet "C:/RailsInstaller/Ruby2.1.0/lib/ruby/g
ems/2.1.0/cache/bundler/git/dotenv-144e50b5b44d79bf4881c97e23671703b3ecbdf0" "C:
/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/dotenv-4d3224523a67"
due to error (2/4): Bundler::Source::Git::GitCommandError Git error: command `gi
t clone --no-checkout --quiet "C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/c
ache/bundler/git/dotenv-144e50b5b44d79bf4881c97e23671703b3ecbdf0" "C:/RailsInsta
ller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/dotenv-4d3224523a67"` in directo
ry C:/Users/Suriyaa/Downloads/platform-samples/api/ruby/basics-of-authentication
has failed.
If this error persists you could try removing the cache directory 'C:/RailsInsta
ller/Ruby2.1.0/lib/ruby/gems/2.1.0/cache/bundler/git/dotenv-144e50b5b44d79bf4881
c97e23671703b3ecbdf0'
fatal: '/cygdrive/c/Users/Suriyaa/Downloads/platform-samples/api/ruby/basics-of-
authentication/C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/cache/bundler/git
/dotenv-144e50b5b44d79bf4881c97e23671703b3ecbdf0' does not appear to be a git re
pository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Retrying git clone --no-checkout --quiet "C:/RailsInstaller/Ruby2.1.0/lib/ruby/g
ems/2.1.0/cache/bundler/git/dotenv-144e50b5b44d79bf4881c97e23671703b3ecbdf0" "C:
/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/dotenv-4d3224523a67"
due to error (3/4): Bundler::Source::Git::GitCommandError Git error: command `gi
t clone --no-checkout --quiet "C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/c
ache/bundler/git/dotenv-144e50b5b44d79bf4881c97e23671703b3ecbdf0" "C:/RailsInsta
ller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/dotenv-4d3224523a67"` in directo
ry C:/Users/Suriyaa/Downloads/platform-samples/api/ruby/basics-of-authentication
has failed.
If this error persists you could try removing the cache directory 'C:/RailsInsta
ller/Ruby2.1.0/lib/ruby/gems/2.1.0/cache/bundler/git/dotenv-144e50b5b44d79bf4881
c97e23671703b3ecbdf0'
fatal: '/cygdrive/c/Users/Suriyaa/Downloads/platform-samples/api/ruby/basics-of-
authentication/C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/cache/bundler/git
/dotenv-144e50b5b44d79bf4881c97e23671703b3ecbdf0' does not appear to be a git re
pository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Retrying git clone --no-checkout --quiet "C:/RailsInstaller/Ruby2.1.0/lib/ruby/g
ems/2.1.0/cache/bundler/git/dotenv-144e50b5b44d79bf4881c97e23671703b3ecbdf0" "C:
/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/dotenv-4d3224523a67"
due to error (4/4): Bundler::Source::Git::GitCommandError Git error: command `gi
t clone --no-checkout --quiet "C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/c
ache/bundler/git/dotenv-144e50b5b44d79bf4881c97e23671703b3ecbdf0" "C:/RailsInsta
ller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/dotenv-4d3224523a67"` in directo
ry C:/Users/Suriyaa/Downloads/platform-samples/api/ruby/basics-of-authentication
has failed.
If this error persists you could try removing the cache directory 'C:/RailsInsta
ller/Ruby2.1.0/lib/ruby/gems/2.1.0/cache/bundler/git/dotenv-144e50b5b44d79bf4881
c97e23671703b3ecbdf0'
fatal: '/cygdrive/c/Users/Suriyaa/Downloads/platform-samples/api/ruby/basics-of-
authentication/C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/cache/bundler/git
/dotenv-144e50b5b44d79bf4881c97e23671703b3ecbdf0' does not appear to be a git re
pository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Git error: command `git clone --no-checkout --quiet
"C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/cache/bundler/git/dotenv-144e50
b5b44d79bf4881c97e23671703b3ecbdf0"
"C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/bundler/gems/dotenv-4d3224523a6
7"`
in directory
C:/Users/Suriyaa/Downloads/platform-samples/api/ruby/basics-of-authentication
has failed.
If this error persists you could try removing the cache directory
'C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/cache/bundler/git/dotenv-144e50
b5b44d79bf4881c97e23671703b3ecbdf0'
C:\Users\Suriyaa\Downloads\platform-samples\api\ruby\basics-of-authentication> |
@bkeepers: What should I do? |
@SuriyaaKudoIsc It looks like there's something wrong with your ruby setup on Windows. I'm not a windows user, so I don't have any advice for you, sorry! |
I could use this line of code: gem "dotenv", github: "bkeepers/dotenv", branch: "bom" or this: gem "dotenv", :git => 'git://github.com/bkeepers/dotenv.git', branch: "bom" The gem installed successfully. 😄 Both codes works! Got the same warning 😟 after running C:\Users\Suriyaa\Downloads\platform-samples\api\ruby\basics-of-authentication> ruby advanced_server.rb
C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/parser.rb:61:in `parse_line': Line "\xEF\xB
B\xBFGH_BASIC_CLIENT_ID=123456789" doesn't match format (Dotenv::FormatError)
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/parser.rb:45:in `block in call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/parser.rb:44:in `each'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/parser.rb:44:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/parser.rb:34:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/environment.rb:13:in `load'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv/environment.rb:9:in `initialize'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:15:in `new'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:15:in `block (2 levels) in load'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:59:in `ignoring_nonexistent_files'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:14:in `block in load'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:46:in `call'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:46:in `block in with'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:45:in `each'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:45:in `reduce'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:45:in `with'
from C:/RailsInstaller/Ruby2.1.0/lib/ruby/gems/2.1.0/gems/dotenv-2.0.2/lib/dotenv.rb:13:in `load'
from advanced_server.rb:6:in `<main>'
C:\Users\Suriyaa\Downloads\platform-samples\api\ruby\basics-of-authentication> |
Gracefully handle files with UTF-8 BOM
Reported in #224, and as @SuriyaaKudoIsc points out, the Unicode byte order mark is used to identify which encoding is being used. This updates dotenv to properly handle the BOM using Ruby's built-in encoding support.
@SuriyaaKudoIsc can you test this out on for me? You should be able to add this to your gemfile:
This should fix #224