small medium large xlarge

29 Sep 2017, 21:57
Antonio Gloria (4 posts)

Hi all,

When I run the command from Chp.3: ‘RAILS_ENV=test​​ ​​bundle​​ ​​exec​​ ​​rails​​ ​​db:drop’, I’m getting the following error: ‘bash: bundle​​: command not found’. The bundle command works fine otherwise - any ideas?

01 Oct 2017, 16:24
David Copeland (467 posts)

What happens when you do gem install bundler and try again?

Not sure what your setup is like, but there are many ways in which this could happen depending on the ruby version manager you are using.

01 Oct 2017, 17:11
Antonio Gloria (4 posts)

Unfortunately running gem install bundler didn’t change anything. I installed Ruby via Arch’s package manager (tried rvm but had some issues there).

01 Oct 2017, 17:26
David Copeland (467 posts)

I’m not sure how to debug this. The error message means that bash cannot find the bundler command in your PATH. You are going to have to locate where bundle is actually installed and make sure that’s in your $PATH. AFAIK, doing FOO=bar some_command means to run some_command with the environment variable FOO set to bar. That works on my bash which is 3.2.57.

01 Oct 2017, 18:13
Antonio Gloria (4 posts)

OK, thanks for your effort - I’ll play around with it some more and report back if i make any progress.

01 Oct 2017, 18:52
Antonio Gloria (4 posts)

Not sure what’s up with my bash v4.4.12, but exporting the variable and then running the command without that bit works. Strange.

07 Oct 2017, 21:39
T.J. Yang (2 posts)

Hi All, I have same issue with string solution of typing all characters !!

  • OS info
Fedora release 26 (Twenty Six)
$ bash --version
GNU bash, version 4.4.12(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

  • shine example src dir
  • works by typing every characters to the bash prompt
[me@fedora01t shine]$ RAILS_ENV=test bundle exec rails db:drop
Dropped database 'shine_test'
[me@fedora01t shine]$ 
  • Not working by copy and past the whole string to bash prompt
[me@fedora01t shine]$ RAILS_ENV=test​​ ​​bundle​​ ​​exec​​ ​​rails​​ ​​db:drop
bash: ​​bundle​​: command not found...
[me@fedora01t shine]$ 
07 Oct 2017, 21:58
David Copeland (467 posts)

Are you copying from the book/PDF? I wonder if there’s some weird special character.

Try this:

> od

od is “octal dump” and it might show that there’s a weird character in there…

08 Oct 2017, 00:52
T.J. Yang (2 posts)

Thanks for the quick reply Dave. Yes, I did copy and paste from the book.

[me@fedora01t ~]$ od
RAILS_ENV=test​​ ​​bundle​​ ​​exec​​ ​​rails​​ ​​db:drop
0000000 040522 046111 057523 047105 036526 062564 072163 100342
0000020 161213 105600 161040 105600 100342 061213 067165 066144
0000040 161145 105600 100342 020213 100342 161213 105600 074145
0000060 061545 100342 161213 105600 161040 105600 100342 071213
0000100 064541 071554 100342 161213 105600 161040 105600 100342
[me@fedora01t ~]$

Another test by pasting the text copy from this forum using less to show special characters.

vi t.txt
copy and paste " RAILS_ENV=test​​ ​​bundle​​ ​​exec​​ ​​rails​​ ​​db:drop"  from this forum into t.txt

[me@fedora01t ~]$ less t.txt
 RAILS_ENV=test<U+200B><U+200B> <U+200B><U+200B>bundle<U+200B><U+200B> <U+200B>
<U+200B>exec<U+200B><U+200B> <U+200B><U+200B>rails<U+200B><U+200B> <U+200B>
[me@fedora01t ~]$ cat t.txt
 RAILS_ENV=test​​ ​​bundle​​ ​​exec​​ ​​rails​​ ​​db:drop
[me@fedora01t ~]$ more t.txt
 RAILS_ENV=test​​ ​​bundle​​ ​​exec​​ ​​rails​​ ​​db:drop
[me@fedora01t ~]$

This is the string I typed in manually and less shows no special characters.
[me@fedora01t ~]$ less t2.txt
RAILS_ENV=test bundle exec rails db:drop
[me@va32fedora01t ~]$

08 Oct 2017, 12:53
David Copeland (467 posts)

Interesting. U+200B is a “zero width space”.

I’ve noticed that copying from the book is often difficult - sometimes you can’t even select stuff.

I had brought this up with the publishers and they said that it’s pretty difficult to achieve the typesetting requirements while also making stuff copy/pasteable. I guess that means manually typing stuff :(

You must be logged in to comment