Note that there are some explanatory texts on larger screens.

plurals
  1. PORails invalid byte running any script
    text
    copied!<p>Can't seem to figure this one out, trying to run any script I get this error:<br> <code>invalid byte sequence in UTF-8 (ArgumentError)</code></p> <p>I have a new OS X machine everything fresh, using Ruby 1.9.3 and Rails 3.2.1 , I've been developing for days with no problem.</p> <p>I left for a few hours today and now I can't run any scripts.</p> <p>I first got the error trying a new migration and thought it was an issue with Postgres, reinstalled, made sure all tables were encoded with UTF-8.</p> <p>I've also reinstalled RVM and Rails.</p> <p>I thought it would be easier to debug if it had to do with the database, but I've created new applications and can't even start the server, receiving the same error.</p> <p>Full stack trying to run the server in a new application on sqlite3<br></p> <pre><code> /Users/mgaughan/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:136:in `split': invalid byte sequence in UTF-8 (ArgumentError) from /Users/mgaughan/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:136:in `setup_environment' from /Users/mgaughan/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.21/lib/bundler/runtime.rb:13:in `setup' from /Users/mgaughan/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.21/lib/bundler.rb:110:in `setup' from /Users/mgaughan/.rvm/gems/ruby-1.9.3-p0@global/gems/bundler-1.0.21/lib/bundler/setup.rb:7:in `' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require' from /Users/mgaughan/Code/something/config/boot.rb:6:in `' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from script/rails:5:in `'</code></pre> <p>Now the more I look at it there is obviously something screwed up with postgresql because in applications on postgresql, bundle fails install pg</p> <p>Stack trace: </p> <pre><code> Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension. /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb checking for pg_config... *** extconf.rb failed *** 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. Provided configuration options: --with-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/bin/ruby --with-pg --without-pg --with-pg-dir --without-pg-dir --with-pg-include --without-pg-include=${pg-dir}/include --with-pg-lib --without-pg-lib=${pg-dir}/lib --with-pg-config --without-pg-config --with-pg_config --without-pg_config /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:1357:in `split': invalid byte sequence in UTF-8 (ArgumentError) from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:1357:in `find_executable0' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:1384:in `block in find_executable' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:280:in `postpone' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for' from /Users/mgaughan/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/mkmf.rb:1383:in `find_executable' from extconf.rb:27:in `' Gem files will remain installed in /Users/mgaughan/.rvm/gems/ruby-1.9.3-p0/gems/pg-0.12.2 for inspection. Results logged to /Users/mgaughan/.rvm/gems/ruby-1.9.3-p0/gems/pg-0.12.2/ext/gem_make.out An error occured while installing pg (0.12.2), and Bundler cannot continue. Make sure that `gem install pg -v '0.12.2'` succeeds before bundling. </code></pre> <p>The mkmf.log file it mentions to check is blank.</p> <p>So I'm guessing that Postgresql might be the root of this problem, but I'm pretty stumped as to why a new application using sqlite3 would still throw this byte error.</p> <p>Any help would be appreciated, let me know if there's any more info I can provide.</p> <h2>Edit</h2> <p>The problem seemed to have resolved itself.</p> <p>The only change to my machine I made was as @Frederick Cheung suggested; I removed an sbin folder from my Path that was from an old NGINX install that had been uninstalled.</p> <p>Possibly that was the difference, but it seems unlikely to me.</p> <p>Regardless, I ran a command and everything was working fine and has been for days.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload