Starting rails server

286 views
Skip to first unread message

Peter Heylin

unread,
Mar 13, 2014, 6:17:04 AM3/13/14
to rubyonra...@googlegroups.com
Hi, 

My apologies if a similar topic exists already. I did search, but could not find anything related to below.

I am new to Ruby on Rails. I am currently setting up a Ruby on Rails environment on a CentOS 6.4 64-bit server. 
When I attempt to start the rails server, I get the following: 


/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.3/lib/active_support/key_generator.rb:2:in `require': cannot load such file -- openssl (LoadError)
        from /usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.3/lib/active_support/key_generator.rb:2:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/application.rb:3:in `require'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/application.rb:3:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails.rb:9:in `require'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails.rb:9:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/all.rb:1:in `require'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/all.rb:1:in `<top (required)>'
        from /root/Documents/ruby/rubyonrails/blog/config/application.rb:3:in `require'
        from /root/Documents/ruby/rubyonrails/blog/config/application.rb:3:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:74:in `require'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:74:in `block in <top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `tap'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'

Would anyone have any advice or suggestions that might help to steer me in the right direction with regard to resolving the above error. 

Thanks in advance,

Peter 

Walter Lee Davis

unread,
Mar 13, 2014, 9:49:09 AM3/13/14
to rubyonra...@googlegroups.com
At a glance, have you confirmed that openSSL is installed in the location where the gem expects it? Also, how did you install Ruby on this machine? (Package, source compile, ?)

Walter

>
> Thanks in advance,
>
> Peter
>
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/7e7ba47a-0f9a-4dc1-967e-4da960bb3dda%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Frederick Cheung

unread,
Mar 13, 2014, 9:50:58 AM3/13/14
to rubyonra...@googlegroups.com


On Thursday, March 13, 2014 10:17:04 AM UTC, Peter Heylin wrote:
Hi, 

My apologies if a similar topic exists already. I did search, but could not find anything related to below.

I am new to Ruby on Rails. I am currently setting up a Ruby on Rails environment on a CentOS 6.4 64-bit server. 
When I attempt to start the rails server, I get the following: 


/usr/local/lib/ruby/gems/2.1.0/gems/activesupport-4.0.3/lib/active_support/key_generator.rb:2:in `require': cannot load such file -- openssl (LoadError)

That sounds  like ruby's openssl bindings are missing. Make sure then openssl development headers (i think on centos that would be the openssl-devel package) are installed before you install ruby. You can build those extensions after ruby has been installed but it's probably easier just to reinstall ruby

Fred

Peter Heylin

unread,
Mar 13, 2014, 1:12:05 PM3/13/14
to rubyonra...@googlegroups.com
@Walter - I have installed Ruby via the source compile method. I am using Ruby 2.1.1 and RubyGems 2.2.2

@all - I have just installed the package openssl-devel and re-compiled Ruby. This has gotten rid of the error relating to Open SSL. 
I am now getting a different error when I attempt to start the rails server. 

/usr/local/lib/ruby/gems/2.1.0/gems/sprockets-2.11.0/lib/sprockets/jst_processor.rb:5:in `<class:JstProcessor>': undefined method `default_mime_type=' for Sprockets::JstProcessor:Class (NoMethodError)
        from /usr/local/lib/ruby/gems/2.1.0/gems/sprockets-2.11.0/lib/sprockets/jst_processor.rb:4:in `<module:Sprockets>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/sprockets-2.11.0/lib/sprockets/jst_processor.rb:3:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/sprockets-2.11.0/lib/sprockets/engines.rb:3:in `require'
        from /usr/local/lib/ruby/gems/2.1.0/gems/sprockets-2.11.0/lib/sprockets/engines.rb:3:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/sprockets-2.11.0/lib/sprockets.rb:44:in `require'
        from /usr/local/lib/ruby/gems/2.1.0/gems/sprockets-2.11.0/lib/sprockets.rb:44:in `<module:Sprockets>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/sprockets-2.11.0/lib/sprockets.rb:3:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/sprockets-rails-2.0.1/lib/sprockets/railtie.rb:5:in `require'
        from /usr/local/lib/ruby/gems/2.1.0/gems/sprockets-rails-2.0.1/lib/sprockets/railtie.rb:5:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/all.rb:11:in `require'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/all.rb:11:in `block in <top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/all.rb:9:in `each'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/all.rb:9:in `<top (required)>'
        from /root/Documents/ruby/rubyonrails/blog/config/application.rb:3:in `require'
        from /root/Documents/ruby/rubyonrails/blog/config/application.rb:3:in `<top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:74:in `require'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:74:in `block in <top (required)>'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `tap'
        from /usr/local/lib/ruby/gems/2.1.0/gems/railties-4.0.3/lib/rails/commands.rb:71:in `<top (required)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'


Would anyone know what might be causing this and what I might have to do to resolve it?

Thanks,

Peter

Walter Lee Davis

unread,
Mar 13, 2014, 2:04:03 PM3/13/14
to rubyonra...@googlegroups.com
Have you installed a JS runtime, like 'therubyracer' or 'nodejs', on your server?

Walter
> --
> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/73ed363d-8dc4-46d6-92a4-174768365701%40googlegroups.com.

Peter Heylin

unread,
Mar 14, 2014, 5:12:34 AM3/14/14
to rubyonra...@googlegroups.com
Thanks for the reply.

I have just installed therubyracer and the error remains. 

nodejs is not installed on the server. 



On Thursday, March 13, 2014 10:17:04 AM UTC, Peter Heylin wrote:
Message has been deleted

Peter Heylin

unread,
Mar 14, 2014, 6:17:19 AM3/14/14
to rubyonra...@googlegroups.com
Hi, 

I got it sorted. Here is what I did to fix it: 

I found a commit in the Sprockets Github repo (https://github.com/sstephenson/sprockets/commit/743c1b1a6433195e440e2d863e5d4767cc41271a) when searching for a fix for the undefined method error relating to default_mime_type. I then applied this change to the following ruby scripts in the sprockets 2.11.0 gem directory: jst_processor, sass_compressor, closure_compressor, uglifier_compressor, sass_template, scss_template. 

I then edited my GemFile to activate therubyracer within my gem environment. 

Thanks for your assistance. 

Peter

On Thursday, March 13, 2014 10:17:04 AM UTC, Peter Heylin wrote:

Javix

unread,
Jan 12, 2015, 5:31:42 AM1/12/15
to rubyonra...@googlegroups.com
Hi guys, I have the same problems:
I can't figure out why I have the following error when trying to run `rails s` on a Windows 7  x64 box:
```
C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-2.12.3/lib/sprockets/jst_processor.rb:5:in `<class:JstProcess

or>': undefined method `default_mime_type=' for Sprockets::JstProcessor:Class (NoMethodError)
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-2.12.3/lib/sprockets/jst_processor.rb:4:in `<mod
ule:Sprockets>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-2.12.3/lib/sprockets/jst_processor.rb:3:in `<top
 (required)>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-2.12.3/lib/sprockets/engines.rb:3:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-2.12.3/lib/sprockets/engines.rb:3:in `<top (requ
ired)>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-2.12.3/lib/sprockets.rb:44:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-2.12.3/lib/sprockets.rb:44:in `<module:Sprockets
>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-2.12.3/lib/sprockets.rb:3:in `<top (required)>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-rails-2.2.2/lib/sprockets/railtie.rb:5:in `requi
re'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/sprockets-rails-2.2.2/lib/sprockets/railtie.rb:5:in `<top
(required)>'
        from c:/Users/ZFTC0418/Documents/projects/rails_draft/config/application.rb:10:in `require'
        from c:/Users/ZFTC0418/Documents/projects/rails_draft/config/application.rb:10:in `<top (required)>'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in
`require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in
`block in server'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in
`tap'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in
`server'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in
`run_command!'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required

)>'
        from bin/rails:4:in `require'
        from bin/rails:4:in `<main>'
```
Reproduced with the following configuration:
- OS: Windows 7 x 64bits
- Ruby `ruby 2.1.5p273 (2014-11-13 revision 48405) [x64-mingw32]`
- sprockets version 2.12.3

The Gemfile has the line with therubyracer gem commented:
```
#gem 'therubyracer', platforms: :ruby
```
 I have node.js installed:
```
node -v
v0.10.35
```
and node gem too:
```
node (0.0.2)
```
Any idea on how to fix that ? Thank you.

Jason Fleetwood-Boldt

unread,
Jan 12, 2015, 10:51:56 AM1/12/15
to rubyonra...@googlegroups.com

Javix,

ROR on Windows is basically unsupported (particularly on this list). The recommend path for you is to virtualize Ubuntu inside of you Windows setup and run ROR in Ubuntu. 

-Jason



--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

Serguei Cambour

unread,
Jan 12, 2015, 11:00:59 AM1/12/15
to rubyonra...@googlegroups.com
Thank you, Jason, for your response.
It is totally false about Rais is not supported on Windows.
I managed to code in RoR on multiples Windows boxes without any problem. Virtualizing it with VirtualBox or something else would be a real overkill :).


--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/3TWXtLd4P-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rubyonrails-ta...@googlegroups.com.

To post to this group, send email to rubyonra...@googlegroups.com.

Jason Fleetwood-Boldt

unread,
Jan 12, 2015, 11:31:23 AM1/12/15
to rubyonra...@googlegroups.com
On Jan 12, 2015, at 11:00 AM, Serguei Cambour <s.ca...@gmail.com> wrote:

Thank you, Jason, for your response.
It is totally false about Rais is not supported on Windows.


Who provides that support? I’ve been on this list for several years and every time someone comes to the list asking about ROR on Windows they got hostile responses. It’s possible to do, but it is not supported by this forum. That’s what I meant by “unsupported”


I managed to code in RoR on multiples Windows boxes without any problem. Virtualizing it with VirtualBox or something else would be a real overkill :).


Really, you are like the 12th person in the last 6 months who has asked every time someone asks Colin Law always gives the same answer: Virtualize Ubuntu if you want to run ROR on Windows.

-Jason

Serguei Cambour

unread,
Jan 12, 2015, 11:39:25 AM1/12/15
to rubyonra...@googlegroups.com
I think it comes outside the current topic because talking about non-supporting of Rails on Windows is too vast, - rails (as gem ) depends on multiple gems; Most of them propose OS-dependent versions, including Windows.
I'm talking about sprockets gem and rails.

--
You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/3TWXtLd4P-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rubyonrails-ta...@googlegroups.com.
To post to this group, send email to rubyonra...@googlegroups.com.

Colin Law

unread,
Jan 12, 2015, 11:41:54 AM1/12/15
to rubyonra...@googlegroups.com
On 12 January 2015 at 16:30, Jason Fleetwood-Boldt <te...@datatravels.com> wrote:
>
> On Jan 12, 2015, at 11:00 AM, Serguei Cambour <s.ca...@gmail.com> wrote:
>
> Thank you, Jason, for your response.
> It is totally false about Rais is not supported on Windows.
>
>
>
> Who provides that support? I’ve been on this list for several years and
> every time someone comes to the list asking about ROR on Windows they got
> hostile responses. It’s possible to do, but it is not supported by this
> forum. That’s what I meant by “unsupported”

I don't think it is true to say that hostile responses are given, I
think it is more a matter of pointing out that most rails developers
use Linux or Mac and getting support for windows problems will be more
difficult.

>
>
> I managed to code in RoR on multiples Windows boxes without any problem.
> Virtualizing it with VirtualBox or something else would be a real overkill
> :).
>
>
>
> Really, you are like the 12th person in the last 6 months who has asked
> every time someone asks Colin Law always gives the same answer: Virtualize
> Ubuntu if you want to run ROR on Windows.

Or dual boot Win and Ubuntu (my preferred route), or of course run
windows in VM inside Ubuntu for the rare occasions you absolutely need
windows.

Colin

Hassan Schroeder

unread,
Jan 12, 2015, 12:24:13 PM1/12/15
to rubyonrails-talk
On Mon, Jan 12, 2015 at 8:39 AM, Serguei Cambour <s.ca...@gmail.com> wrote:
> I think it comes outside the current topic because talking about
> non-supporting of Rails on Windows is too vast

Perfect. Two posts asserting that Rails on Windows is "supported",
zero posts actually *supporting the Windows user with the problem*.

Sounds about right :-)

--
Hassan Schroeder ------------------------ hassan.s...@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

Jason Fleetwood-Boldt

unread,
Jan 12, 2015, 12:30:58 PM1/12/15
to rubyonra...@googlegroups.com

That was my point exactly.

-Jason

Javix

unread,
Jan 13, 2015, 6:53:12 AM1/13/15
to rubyonra...@googlegroups.com
The problem is that I had to download and install all the Rails related gems and their dependencies separately because of firewall and proxi restricitions (it was a real headache). The problem was due to the tilt version (1.1) in the generated Gemfile.lock file; After deleting that file and re-running
bundle install --local

everything came to normal and
rails s

comand worked without any problems. Unfortuantely, nobody of the above responders had the idea to do that. Thank s to Josh from Sprockets repo for the idea.

Cheers

Colin Law

unread,
Jan 13, 2015, 7:05:03 AM1/13/15
to rubyonra...@googlegroups.com
On 13 January 2015 at 11:53, Javix <s.ca...@gmail.com> wrote:
> The problem is that I had to download and install all the Rails related gems
> and their dependencies separately because of firewall and proxi
> restricitions (it was a real headache). The problem was due to the tilt
> version (1.1) in the generated Gemfile.lock file; After deleting that file
> and re-running
> bundle install --local
>
> everything came to normal

What version of tilt are you seeing in Gemfile.lock now?

Colin

> rails s
>
> comand worked without any problems. Unfortuantely, nobody of the above
> responders had the idea to do that. Thank s to Josh from Sprockets repo for
> the idea.
>
> Cheers
>
> On Monday, January 12, 2015 at 6:30:58 PM UTC+1, Jason FB wrote:
>>
>>
>> That was my point exactly.
>>
>> -Jason
>>
>>
>>
>> On Jan 12, 2015, at 12:23 PM, Hassan Schroeder <hassan.s...@gmail.com>
>> wrote:
>>
>> On Mon, Jan 12, 2015 at 8:39 AM, Serguei Cambour <s.ca...@gmail.com>
>> wrote:
>>
>> I think it comes outside the current topic because talking about
>> non-supporting of Rails on Windows is too vast
>>
>>
>> Perfect. Two posts asserting that Rails on Windows is "supported",
>> zero posts actually *supporting the Windows user with the problem*.
>>
>> Sounds about right :-)
>>
>>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-ta...@googlegroups.com.
> To post to this group, send email to rubyonra...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/rubyonrails-talk/812241ec-b351-46c9-b8aa-d6729728820b%40googlegroups.com.

Serguei Cambour

unread,
Jan 13, 2015, 7:15:07 AM1/13/15
to rubyonra...@googlegroups.com

You received this message because you are subscribed to a topic in the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/rubyonrails-talk/3TWXtLd4P-0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to rubyonrails-ta...@googlegroups.com.

To post to this group, send email to rubyonra...@googlegroups.com.

Colin Law

unread,
Jan 13, 2015, 8:40:24 AM1/13/15
to rubyonra...@googlegroups.com
On 13 January 2015 at 12:14, Serguei Cambour <s.ca...@gmail.com> wrote:
> 1.1 see Gemfile.lock before:
> https://gist.github.com/Javix/efa6192ae995e89db950
> 1.4.1 after see Gemfile.lock after:
> https://gist.github.com/Javix/1430ae66cfca2aa3a6f9

How did it get to be 1.1 in the first place, which is an ancient
version from 2010? Are you upgrading an existing app, or possibly the
app was initially created with an old version of rails?

Colin
> https://groups.google.com/d/msgid/rubyonrails-talk/CAJGQ%3DvZxw8f%3Dkf4Ah7mBPpuqf9%3DSqD6oCg140FAnk0WQrZnVHQ%40mail.gmail.com.

Serguei Cambour

unread,
Jan 13, 2015, 9:21:22 AM1/13/15
to rubyonra...@googlegroups.com
No, I didn't upgrade the app. As I explained previously, I had to download all the gems and install them locally one by one. Some of them were dependent on 1.1, that's why I had to install it instead of 1.4.1.

Colin Law

unread,
Jan 13, 2015, 9:49:22 AM1/13/15
to rubyonra...@googlegroups.com
On 13 January 2015 at 14:20, Serguei Cambour <s.ca...@gmail.com> wrote:
> No, I didn't upgrade the app. As I explained previously, I had to download
> all the gems and install them locally one by one. Some of them were
> dependent on 1.1, that's why I had to install it instead of 1.4.1.

Oh, I see, so you had picked up a version of another gem that required
tilt 1.1. So as part of your fix you presumably also got a later
version of that gem.
> https://groups.google.com/d/msgid/rubyonrails-talk/CAJGQ%3Dva%2Bfn-oAHXPDRr_vYHaSERmEW_j_%2Bh3H1Gt_jWRDZnL%2BA%40mail.gmail.com.

Serguei Cambour

unread,
Jan 13, 2015, 9:54:35 AM1/13/15
to rubyonra...@googlegroups.com
I think it was smth lik that. Anywa, it seems a bit strange: when trying to install a Rails-related gem that was dependent from exactlly 1.1 of tilt, running 'bundle install --local' was OK. But failed when running 'rails s'. And after removing Gemfile.lock and re-running bundle again, everything came to normal.

Colin Law

unread,
Jan 13, 2015, 10:39:47 AM1/13/15
to rubyonra...@googlegroups.com
On 13 January 2015 at 14:54, Serguei Cambour <s.ca...@gmail.com> wrote:
> I think it was smth lik that. Anywa, it seems a bit strange: when trying to
> install a Rails-related gem that was dependent from exactlly 1.1 of tilt,
> running 'bundle install --local' was OK. But failed when running 'rails s'.
> And after removing Gemfile.lock and re-running bundle again, everything came
> to normal.

I can't see any gems in Gemfile.lock that require exactly tilt 1.1. I
wonder whether you misinterpreted the dependency for sass-rails and
sprockets for for tilt ~> 1.1. That does not mean exactly 1.1 but
anything between 1.1 and 2. Generally in that situation you should go
for the latest in the range, so 1.4.1. Presumably when you ran bundle
initially you had downloaded only 1.1. When you ran it again 1.4.1
must have been available so it used that.

By the way, it is easier to follow the thread if you insert your
replies inline rather than in front of the previous message

Colin
Reply all
Reply to author
Forward
0 new messages