This is RHEL5, Rails 2.1.0. I got this error message “no such file to load — sqlite3/database” after following the first example from book “Agile-Web-Development-Rails-2nd”. After searching around, finally found the answer at http://andrew.chalkley.org/post/39984897/fix-sqlite3-error-on-ruby-enterprise-edition:
cd /usr/lib/ruby/gems/1.8/gems/sqlite3-ruby-1.2.2/lib/sqlite3
sudo chmod +r *
Today I got this error when using ‘rake db:migrate’:
sqlite3_api.so: undefined symbol: RSTRING_PTR The answer is at http://d.hatena.ne.jp/GARAPON/20080602/1212387419, the ruby version in RHEL5 is 1.8.5, so workaround is: Put the following lines in file '/usr/lib/ruby/1.8/i386-linux/ruby.h': #define RSTRING_PTR(s) (RSTRING(s)->ptr) #define RSTRING_LEN(s) (RSTRING(s)->len) gem uninstall sqlite3-ruby gem install sqlite3-ruby rake db:migrate Then do the above 'sudo chmod +r *' AGAIN to get rid of the 'no such file to load' error message. [root@wpprdwf ~]# gem install mysql -- --with-mysql-lib=/usr/lib/mysql Building native extensions. This could take a while... Successfully installed mysql-2.7 1 gem installed
I found that the fix posted here 9a permissions setting) http://blog.innerewut.de/ fixed this issue for me on Mac 10.4.11 with Ruby 1.8.7 patch 22 and Rails 2.1.3. You may have to alter the path if your gems are not in the example path he uses. I did, and had no further issues.
Comment by cthornhill — July 16, 2008 @ 6:21 pm |
for me the fix was on http://www.icoretech.org/2008/07/06/no-such-file-to-load-sqlite3-database which is a good blog btw
Comment by raffat — July 27, 2008 @ 9:05 pm |
Worked perfectly, after trying many suggestions that didn’t.
Running Ubuntu 8.10
Ruby 1.8.7
Rails 2.2
RubyGemms 1.3.1
Sqlite 3.5.9
Comment by Adam — December 23, 2008 @ 3:17 am |